Clear Form

Definition:

NDLLibrary.clearForm(ndlParams)

 

Description:

Clears all Elements on the form by setting them to empty and then redisplays any static values in input mappable Elements.

 

 

Returns:

true

 

Code Sample:

This sample shows how to use clearForm with your own JavaScript functions. Note that when calling clearForm in a function that is not generated from an Element's event property, you need to create an ndlParams object to pass to clearForm, but clearForm doesn't need any of the four properties specified in the default ndlParams object and so these properties are not added here. When used in a function which is generated from an Element's event property, the ndlParams object is supplied by Digitise Forms and so the first line in the code below is not needed.

var ndlParams = {};

return NDLLibrary.clearForm(ndlParams);

 

Notes:

Input mappings are not reread, so Elements such as a Radio List where the values are input from a Datasource, will be blank after running this function.

For Elements which can be input mapped, where you have entered a static value in the Data properties instead of input mapping the Element to a Datasource, this value will be displayed in the Element after the Element has been cleared.

This function doesn't clear or reset the validation status of the Elements.

 

Using as Predefined Action in Event:

When assigned to an Event as a predefined action, this function doesn’t require any editing.

 

 


See also:

Reset Form