- 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-04-2024 10:46 PM
Hi @levino
Could you please check if the value of the field request_type is 'SAP Read-Only'. I suspect that you are doing the comparison with the field label instead of value.
Thanks and Regards
Amit Verma
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-04-2024 10:50 PM
Hi Amit
i am using the value not the label
Thanks
Levino
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-04-2024 11:50 PM
I tried to simulate your issue. I am able to make it work with the same On-Submit Client Script which you have shared. Can you please check if the variable which you are passing to the if block to check the condition i.e. request != 'sap_read_only' is the same as the question value as shown below :
Your script is working as expected as shown below :
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:46 AM