- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
Hello,
I have two fields on a form: 'Access to Remove' or 'Additional application(s) to be removed'. I need to ensure that the user selects one of the fields and if at least one of the fields is not selected, the user should not be able to submit the for. Initially, I made both fields mandatory, but the user would have to make a selection from both fields. I am trying to configure the field so that the user has to select only one field, but if they select neither field, they should not be able to submit the form. Please advise, thanks!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
You can try On submit client script
Table: Your form’s table name (e.g., sc_req_item, incident, etc.)
Type: onSubmit
UI Type: All
function onSubmit() {
var access = g_form.getValue('access_to_remove');
var apps = g_form.getValue('additional_applications_to_be_removed');
if (!access && !apps) {
g_form.showFieldMsg('access_to_remove', 'Please fill at least one of the two fields.', 'error');
return false; // Block form submission
}
return true; // Allow submission
}
Thanks,
Vignesh
"If this solution resolves your issue, kindly mark it as correct."
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
You can try On submit client script
Table: Your form’s table name (e.g., sc_req_item, incident, etc.)
Type: onSubmit
UI Type: All
function onSubmit() {
var access = g_form.getValue('access_to_remove');
var apps = g_form.getValue('additional_applications_to_be_removed');
if (!access && !apps) {
g_form.showFieldMsg('access_to_remove', 'Please fill at least one of the two fields.', 'error');
return false; // Block form submission
}
return true; // Allow submission
}
Thanks,
Vignesh
"If this solution resolves your issue, kindly mark it as correct."