This topic is locked
[SOLVED]

 changing one field based on another

2/19/2011 1:32:23 PM
PHPRunner General questions
D
duck author

// table

var tName = 'user';

// form variables

var iheight = 'Height';

var ctrlheight = Runner.controls.ControlManager.getAt(tName, pageid, iheight );
var iCm_Inch = 'Cm_Inch';

var ctrlCm_Inch = Runner.controls.ControlManager.getAt(tName, pageid, iCm_Inch);

// change height value based on unit type

ctrlCm_Inch.on('change', function(e){

if (this.getValue() == '1'){

ctrlheight.setValue(2.24*height)

else

ctrlheight.setValue(height/2.24);

}

});
loaded into function OnPageLoad(pageid)

{

page

and has no action at all?

Sergey Kornilov admin 2/19/2011

I recommend to post your application to Demo Account and open a ticket at http://support.xlinesoft.com sending your Demo Account URL. 'Demo Account' button can be found on the last screen in the program.

D
duck author 2/20/2011



I recommend to post your application to Demo Account and open a ticket at http://support.xlinesoft.com sending your Demo Account URL. 'Demo Account' button can be found on the last screen in the program.


this didn't work for me

I couldn't login and could not find how to register

my email wasn't recognized (maybe because i just bought it recently?)

I managed to make some progress by writing a form and javascript into the html page- its very messy

I retrieved the value into the data base with the following on the javascript onload event page:-
var ctrl = Runner.getControl(pageid, 'Height');
// i tried to copy the value of Height variabl into the textbox id=heit but didnt work

// var value = ctrl.getValue();

// this hides the regular height box
ctrl.hide();
// this copies the value of textbox id=heit into the data variable $_REQUEST["heit"] on 'after record updated' events page

this.on('beforeSave', function(formObj, fieldControlsArr, pageObj){

var val = $("#heit").val();

formObj.baseParams['heit'] = val;

});
// this is on 'after record updated' event page

$heit = $_REQUEST["heit"];

$user = $values["id"];

global $conn;

$strupdate = "UPDATE user SET user.Height = $heit WHERE user.id = $user";

db_exec($strupdate,$conn);
What I continue to struggle with is to set my custom form field (id=heit) to have the default value of user.height when the page loads
I have examined all the manuals/forum and been unable to establish the circuit of a database variable value >> javascript form variable value >> database variable value.

in its simplest form

if anyone could point me to an example I would appreciate it very much

Sergey Kornilov admin 2/20/2011

We won't be able to help you without having access to your application.
Post your application to Demo Account and open a ticket at http://support.xlinesoft.com sending your Demo Account URL. 'Demo Account' button can be found on the last screen in the program. More info: http://xlinesoft.com/phprunner/docs/what_is_demoaccount.htm

D
duck author 2/22/2011



We won't be able to help you without having access to your application.
Post your application to Demo Account and open a ticket at http://support.xlinesoft.com sending your Demo Account URL. 'Demo Account' button can be found on the last screen in the program. More info: http://xlinesoft.com/phprunner/docs/what_is_demoaccount.htm



sorry- operator error- i've uploaded the files

ive redefined the fields so have 3 with them hidden on the edit screen and javascript to link the fields so editing any one dynamically updates the screen and when saved fills all 3 database variables, what it doesnt do is copy the data base variables into the form on loading

Sergey Kornilov admin 2/22/2011

Now you need to open a ticket at http://support.xlinesoft.com sending your Demo Account URL so someone from support team can help you.

D
duck author 3/8/2011



Now you need to open a ticket at http://support.xlinesoft.com sending your Demo Account URL so someone from support team can help you.


I fixed it by using the guidelines of 'Show dropdown list of US states if US was selected in country list' in the manual
its a big manual and difficult to relate the workflow to the references at times