Please enable JavaScript to view this site.

Navigation: Advanced topics > Programming topics

How to mark fields invalid

Scroll Prev Next More

 

You can mark fields as valid or invalid in the generated application.

Variable

ctrl

the current field, a Control object.

Functions

ctrl.setInvalid( message )

Marks the control invalid.

ctrl.setValid()

Marks the control valid.

Note: setValid() only removes the status set by setInvalid(), it has no effect on other validations.

 

Note: the page can not be saved when there are invalid fields on it.

Example

if( ctrl.getValue() > 100 )
 ctrl.setInvalid( 'Price can not exceed 100' );
else
 ctrl.setValid();

See also:

JavaScript API: Control object > getValue()

JavaScript API: RunnerPage object > hideField()

JavaScript API: RunnerPage object > showField()

Field events

About Control object