FormMaker provides a number of options for controlling how fields are validated, and by default links this validation up to the submission actions available for buttons etc.
It is however possible to enable validation of each field as the user is entering their data. To do this, you would need to add an 'onload' event to your page, with the following custom script content.
You should now find that each field is validated as you enter or select the values.
If your page also makes use of dojo form widgets (such as a Filtering Select or Currency field) then you should add the following code to the onload event to make sure the validation of these also works in the same way.
If required, you can place this code into a function in an external script file, and just call this new function from the onload event definition on the Field Details tab.
It is however possible to enable validation of each field as the user is entering their data. To do this, you would need to add an 'onload' event to your page, with the following custom script content.
dojo.query('input[type=text], input[type=checkbox], input[type=radio], input[type=password], textarea, select')
.onkeyup(function(e){hyf.validation.validateField(e.target);})
.onchange(function(e){hyf.validation.validateField(e.target);})
.onfocus(function(e){hyf.validation.validateField(e.target);});
You should now find that each field is validated as you enter or select the values.
If your page also makes use of dojo form widgets (such as a Filtering Select or Currency field) then you should add the following code to the onload event to make sure the validation of these also works in the same way.
var widgets = dijit.findWidgets(document);
for (var i=0; i < widgets.length; ++i)
{
dojo.connect(widgets[i], 'onKeyUp', function(e){hyf.validation.validateField(dijit.byId(e.target.getAttribute('id')));});
dojo.connect(widgets[i], 'onChange', function(e){hyf.validation.validateField(dijit.byId(e.target.getAttribute('id')));});
dojo.connect(widgets[i], 'onFocus', function(e){hyf.validation.validateField(dijit.byId(e.target.getAttribute('id')));});
}
If required, you can place this code into a function in an external script file, and just call this new function from the onload event definition on the Field Details tab.
RE: How do I enable 'as you type' validation?