How to abort form submission using OnChange client Script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-13-2022 06:02 AM
Hi,
i need to abort the form submission based on validation of single line text field(email field with regex as /^[_A-Za-z0-9-\\+]+(\\.[_A-Za-z0-9-]+)*(@gmail|@test)\.com$/ ) ,and the field is not mandatory, so can we able to abort action using onChange client script
or suggest any onSubmit client script.
Thank You.
- Labels:
-
Multiple Versions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-13-2022 06:06 AM
Hello,
Since it is non mandatory field you cannot abort using On change so you have to write Submit client script only, here is the article which has code for this
https://community.servicenow.com/community?id=community_article&sys_id=8e9a945f1b544510a59033f2cd4bcb39
Mark my answer as correct if that helps
Regards
Regards,
Musab
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-13-2022 06:11 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-13-2022 08:54 AM
Hello,
If issue is resolved Kindly mark my answer as correct, You can even try with Markus no code solution as well.
Regards
Regards,
Musab

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-18-2022 04:54 AM
Hello,
If you are fine with my reply kindly mark my answer as correct and close the thread.
Regards
Regards,
Musab