- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-14-2024 03:29 AM
Hi All,
I have a requirement where there should be two mandatory checkboxes on the catalog item form and user on selecting both checkboxes can submit the form.
Even though i have set both the checkboxes to mandatory i am able to submit with only 1 checkbox .
How to set both checkboxes mandatory?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-14-2024 04:07 AM
There might be a script overriding the mandatory field setting. Try checking the 'Catalog Item Script' section for any onSubmit or onChange functions that might be bypassing the validation. You can also try making the checkboxes 'Dependent' on each other - that way, selecting one will automatically check the other.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-14-2024 04:47 AM
Hi @phr,
Please follow this doc below:
Please let me know if you need any help.
Please accept my solution if it resolves your issue and thumps 👍 up
Thanks
Jitendra
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-14-2024 07:10 AM - edited 06-14-2024 07:11 AM
create a simple onsubmit script with last order to run at last with if (firstcheckbox && secondcheckbox)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-14-2024 07:15 AM
Hi @phr
If above scenarios are not working as mentioned by @Jitendra Diwak1 ,
Please write onsubmit client script and abort the submission if both checkboxes are not selected.
function onSubmit() {
var cbox1 = g_form.getValue('first_field_name');
var cbox2 = g_form.getValue('second_field_name');
if (cbox1 !== 'true' || cbox2 !== 'true') {
alert('select both checkboxes to submit the form.');
return false;
}
return true;
}
Thanks and Regards
Sai Venkatesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-14-2024 03:40 AM
Hi @phr
You can use Selection Required checkbox to make checkbox mandatory as shown in below snippet
Thanks,
Trupti
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-14-2024 04:31 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-14-2024 04:05 AM
Hi @phr,
You can open those variable make them mandatory as selection Required checkbox on variable as True.
Please accept my solution if it works for you and thumps up.
Thanks
Jitendra
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-14-2024 04:31 AM