The XML template can include form scripts that validate form data to help ensure that the user completes required fields and to alert the user when they do not. Scripted data validation occurs when a user saves a form in the Form Editor.
Follow these steps:
The form definition appears in the text editor.
Note: Your JavaScript must report validity by calling the editor.setValid method. Calling this method with false indicates that the form is invalid and thus saving should be disallowed.
<validation language="javascript" client="eclipse">
if (editor.getTextFieldValue("mrcategory").length() == 0)
{
editor.alert("You must select a category.");
editor.setValid(false);
}
</validation>
For example:
editor.alert("Form validation failed")
Field validation is set.
|
Copyright © 2013 CA.
All rights reserved.
|
|