- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-22-2017 07:47 AM
I currently have a select box and for the default value I have it as "-- Please Select --" but I also need this field to be mandatory field. When testing the red asterisk is there but if the field is left blank and the person submits the form anyway it still allows them to submit without filling in the mandatory fields.
Can someone point me in the right direction on how to fix this issue?
Solved! Go to Solution.
- Labels:
-
Service Catalog

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-22-2017 10:53 AM
Hey Craig,
you can add an onSubmit client script:
function onSubmit() {
//Type appropriate comment here, and begin script below
var v = g_form.getValue('select');//the name of your field
if(v == '-- Please Select --') {
alert('You must choose an option in the select field');
return false;
}
}
NOTE -
In place of "--Please Select --" put the value of that choice.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-22-2017 12:59 PM
So a couple of things:
1. var v = g_form.getValue('Type of Request');//the name of your field
This is not the name of your field, but rather its label; the name is salesforce_type.
So: var v = g_form.getValue('salesforce_type');//the name of your field
2. null is fine
Please change the line and let me know how it works for you.
Harel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-22-2017 01:03 PM
This worked, thank you so much!
Thank you,
Craig Zeleznick
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-22-2017 01:13 PM
Good.
Feel free to mark answers as correct to get them out of the unanswered queue.
And helpful, if anything was helpful
harel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-23-2017 12:00 PM
Lol.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-22-2017 09:35 AM