- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2014 08:15 AM
Hi,
I have created a onSubmit script to validate a field and i want to abort the saving the form if the validation fails. But i am not able to do it using client script. what i am doing is, pop up a error message if validation fails, but as soon as i click on the ok button, it proceed and form saved. Can some one suggest a better way to do that?
Thanks in advance,
Santosh Kumar
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2014 08:21 AM
Can you share your script? You should be able to cancel the submission by returning false in the onSubmit function. Take a look at this wiki article - Client Scripts - ServiceNow Wiki
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2014 08:21 AM
Can you share your script? You should be able to cancel the submission by returning false in the onSubmit function. Take a look at this wiki article - Client Scripts - ServiceNow Wiki
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-18-2014 02:48 AM
Thanks Jim, Its working.
Just missing the last line to return false to the on submit function.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-18-2014 07:31 AM
You are welcome.