- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-04-2024 10:33 PM
Hi Team
basically if select box is not sap then users need to select atleast one checkboxe ' ccl,ccz,other ,entelar'
Please help me to fix my script
Thank You
Levino
function onSubmit() {
//Type appropriate comment here, and begin script below
var entelar = g_form.getValue('entelar_egl');
var other = g_form.getValue('other');
var ccl = g_form.getValue('ccl');
var ccz = g_form.getValue('ccz');
var request = g_form.getValue('request_type');
if((request != 'SAP Read-only') && (ccl == 'false' || ccz == 'false' || entelar == 'false' || other == 'false')){
g_form.addInfoMessage("please make a selection");
return false;
}
}
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2024 02:05 AM
The condition needs to be tweaked so that it could check if at least one checkbox is checked. As of now, it is checking for all the checkboxes to be checked. Try with the condition as :
if((request != 'sap_read_only') && (ccl == 'false' && ccz == 'false' && entelar == 'false' && other == 'false'))
Please mark this response as correct and helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2024 12:48 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2024 01:47 AM
Is it not working on Service Portal or on Service Portal and Native UI Both ? If Service Portal, check if you have configured the On-Submit Client Script to run on all by selecting UI Type as All
Please mark this response as correct and helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2024 01:49 AM
Hi Amit
i had selected ui type as all.
is my script ok, the and or condition
Thanks
Levino
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2024 02:05 AM
The condition needs to be tweaked so that it could check if at least one checkbox is checked. As of now, it is checking for all the checkboxes to be checked. Try with the condition as :
if((request != 'sap_read_only') && (ccl == 'false' && ccz == 'false' && entelar == 'false' && other == 'false'))
Please mark this response as correct and helpful if it assisted you with your question.