This topic is locked

Hide Fields in ADD Form (On The Fly)

6/17/2010 9:24:02 AM
PHPRunner General questions
N
netmedia59 author

Hello,
Is there a way, in an ADD/EDIT form, to hide fields (on the fly) depending of another field :

  • A field in a LookUp Table, a CheckBox or a TextField
    For example my TableName is prod

    The field is Redirection
    Thanks very much
    Olivier

    Lille (FRANCE)

    PHPR 5.2

A
ann 6/17/2010

Olivier,
use JavaScript API to hide fields.

More information:

http://xlinesoft.com/phprunner/docs/javascript_api.htm

N
netmedia59 author 6/17/2010

Hey Ann,

Thanks for the answer
If I want to hide the Field Cat2 depending on Cat1 (LookUp Field), is that code OK ?

var ctrlCat1 = Runner.getControl(pageid, 'Cat1');

var ctrlCat2 = Runner.getControl(pageid, 'Cat2');
ctrlCat1.on('change', function(e){

if (this.getValue() == 100){

assign("Cat2_fieldblock",false);

}else{

}

});
Thanks
Olivier



Olivier,
use JavaScript API to hide fields.

More information:

http://xlinesoft.com/phprunner/docs/javascript_api.htm

A
ann 6/17/2010

Olivier,
modify code in the following way:

if (this.getValue()== 100){

document.getElementById("hidediv1").style.display="none";

}



Then proceed to the HTML mode on the Visual Editor tab and change code (bold):

{BEGIN Cat2_fieldblock}

<tr id=hidediv1><td class=shade width=150>

{BEGIN Cat2_label}{$label userstable Cat2}{END Cat2_label}

</td><td width=250>

{$Cat2_editcontrol}

</td></tr>

{END Cat2_fieldblock}