Shows the previously hidden field and its label. The showField() method is available in the JavaScript OnLoad event of the Add/Edit/View/Register pages.
Syntax
pageObj.showField(field);
Arguments
field
the field name. Example: "Make".
Return value
No return value.
Example 1
Show the Make field. Add the following code to the JavaScript OnLoad event:
pageObj.showField("Make");
Example 2
Show the State field, if the Country is USA; hide the field otherwise. Add the following code to the JavaScript OnLoad event:
var ctrl = Runner.getControl(pageid, "Country");
if(ctrl.getValue() != "USA")
pageObj.hideField("State");
ctrl.on('change', function(){
if (this.getValue() == "USA"){
pageObj.showField("State");
}
else {
pageObj.hideField("State");
}
});
See also:
•JavaScript API: Control object > getValue()
•JavaScript API: Control object > getControl()
•JavaScript API: RunnerPage object > hideField()
•RunnerPage class: showField()
•RunnerPage class: hideField()
•Show dropdown list of US states if US was selected in country list
•JavaScript API: RunnerPage object