onChange and onSubmit functions in the same Catalog Client Script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-14-2013 11:24 AM
I have a Service Catalog item that needs a validation added to a Single Line Text field. We'd like to do the validation onChange as well as onSubmit. I know an easy way to do it would be to create two separate Catalog Client Scripts...one for onChange and one for onSubmit. But we'd like to keep this to one script.
Does anyone know if that is possible?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-15-2013 11:52 AM
In that case you can just use an onSubmit and utilize the scroll to feature of g_form.showErrorBox() to auto scroll the user to the offending field on the form.
http://wiki.servicenow.com/index.php?title=GlideForm_%28g_form%29#showErrorBox
