- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-04-2022 04:46 AM
Hi all,
I have created two checkbox on a form which are "Accept" and "Cancel". The only one checkbox should be selected at a time. When I select a "Accept" then "Cancel" should not be select or vice versa. How can I achieve this?
Thanks!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-04-2022 05:01 AM - edited 10-04-2022 06:02 AM
Hi, You can achieve using UI policies.
Define 1st UI policy as -
Condition -
Accept is true
UI policy Scripts -
Execute if true:
g_form.clearValue("u_cancel");
Execute if false:
g_form.setValue("u_cancel", true);
Define 2nd UI policy as -
Condition -
Cancel is true
UI policy Scripts -
Execute if true:
g_form.clearValue("u_accept");
Execute if false:
g_form.setValue("u_accept", true);
Please try this and let me know.
Thanks,
Sagar Pagar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-04-2022 05:01 AM - edited 10-04-2022 06:02 AM
Hi, You can achieve using UI policies.
Define 1st UI policy as -
Condition -
Accept is true
UI policy Scripts -
Execute if true:
g_form.clearValue("u_cancel");
Execute if false:
g_form.setValue("u_cancel", true);
Define 2nd UI policy as -
Condition -
Cancel is true
UI policy Scripts -
Execute if true:
g_form.clearValue("u_accept");
Execute if false:
g_form.setValue("u_accept", true);
Please try this and let me know.
Thanks,
Sagar Pagar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-04-2022 05:21 PM
You should not be using check-boxes if you want only one thing selected at a time. I mean you would be designing against established computer UI paradigms. You would normally be using radio buttons, however since that is not supported in SN (well, not quite so, but still), you should use a select box.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-04-2022 06:10 PM
I would use a choice field instead. But if you absolutely need the check boxes, you can create a UI policy or client script to enforce only one selection.