Show alert onSubmit if field is not empty
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-31-2016 09:52 AM
How can I set an onSubmit client script alert to display if a field is not empty? I'm not finding anything relevant other than things for catalog items which gives an error.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-01-2016 01:55 AM
Why don't you make the field mandatory instead of checking the field is empty or not if you want user to enter it?
You can either use client script or UI policy for making a field/variable mandatory on the form.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-01-2016 12:04 PM
hey kalai, yep of course. i could do that but the reason i was doing it this way is because if there is a value in that field (not empty) then an attachment is mandatory. is there a better way to derive that functionality? basically, if field a != ' ' then alert and make attachments mandatory to submit

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-01-2016 09:53 PM
Maybe you could use an onchange script or onload to provide the user information about mandatory attachment. I don't see it as a good design that gives the user no clue till submission that an attachment is mandatory.
You can always add the check in onsubmit script to validate if the user has attached the file or not.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-21-2017 10:44 AM
Paul,
Did you find a solution for this? We have the same requirement for Service Portal. My script works in CMS but not the Portal. Wondering if you got yours to work.