Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

onChange and onSubmit functions in the same Catalog Client Script

galvi024
Kilo Explorer

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?

5 REPLIES 5

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