Please enable JavaScript to view this site.

Navigation: Advanced topics > Programming topics > JavaScript API > RunnerPage object > Methods

JavaScript API: RunnerPage object > hideField()

Scroll Prev Next More

 

Hides the field and its label. The hideField() method is available in the JavaScript OnLoad event of the Add/Edit/View/Register pages.

Syntax

pageObj.hideField(field);

Arguments

field

the field name. Example: "Make".

Return value

No return value.

Example 1

Hide the Make field. Add the following code to the JavaScript OnLoad event:

 

pageObj.hideField("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 > showField()

RunnerPage class: showField()

RunnerPage class: hideField()

Show dropdown list of US states if US was selected in country list

JavaScript API: RunnerPage object

JavaScript API