How to restrict the form to be submitted when the script condition matches and to retain oldValue.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago - last edited 3 weeks ago
Hi All,
I am passing a validation when the below script condition matches through onchange Client script. But at the same time I need to restrict user from submitting the form with if the value of the justification field is less than 60.Also if user does any changes to a existing value and try to submit a newValue of less than 60 character, it should not take and the justification field should should retain it's oldValue . I have tried below scripts, onChange is working as expected but not sure how to restrict user from submitting the form with incorrect value without impacting existing value of the field(If form is getting submitted with value length <60).
Please suggest me on this what should be best approach to achieve this ? Please let know if you nee more info .
Thank You
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
here is an update set that creates a Variable Set which can then be added to any Catalog Item that needs it
Do your calcs, use the updateIsError to set the value in the object to True (error), false (good)
the onSubmit checks and will stop submission
I wrote this a few years ago. The old portal (CMS) would stop you submitting a form if there were error messages on a variable. I hadn't used it for ages and was now on the Service Portal and had to create a new item with lots of field validations. A late final check and I was horrified to find I could submit with a plethora of "errors"., I didn't want to rewrite everything as an onSubmit as well, so a bit of lateral thinking and came up with this.
