Executing UI Policy on form submit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-14-2013 02:38 AM
Hi,
I have created a UI policy to check the certain values entered in the text box for e.g. the value length and no special characters. Before submitting the form I want to execute the UI policy and to stop form submission.
Please suggest, how can we execute UI policy on form submission.
- Labels:
-
Performance Analytics
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-18-2013 03:51 AM
This is fine and it works if the value is removed and re-entered again eg.
1. Name is a text field the
2. condition for UI policy is nameISNOTEMPTY
3. The current value is "xyz".
4. I change value from xyz to abc
In above scenario it will not execute the UI policy because the reverse if condition is not satisfied but the face is value of the text field is changed. I am looking out for a solution where even on change of text the UI policy will be enforced. Or at least it should be enforced on form submit. Please suggest.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-20-2013 07:26 AM
The best way to handle this is via client scripts. Can can react to the changing of a free-form text field with an onChange script and you can execute logic to cancel a form submission on an onSubmit client script. These scripts are used for this exact purpose and are useful to learn.
http://wiki.servicenow.com/index.php?title=Client_Scripts#onChange.28.29_Scripts
http://wiki.servicenow.com/index.php?title=Client_Scripts#onSubmit.28.29_Scripts