
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-05-2019 07:38 AM
Hello everyone!
I need some assistance today. I have a custom application (IBM Resilient Integration) that I built out for my security response team and they would like to have a modification done to the checkboxes. Yes, I have already approached them to use select boxes for the selections since it would be easier but they want the users to have to opportunity to select one or more checkbox while making a selection mandatory with an alert if nothing is selected.
Below are the checkboxes that I'm using:
Any guidance or help is greatly appreciated!
Thanks,
Terry
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-05-2019 12:45 PM
Yes, understood the problem.
The earlier code returns error when atleast one of them is false.
so instead of || use && and then it will fire only if all of those are unchecked.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-05-2019 08:22 AM
If its 1 checkbox field, why can't you make this field mandatory for user to select atleast one
g_form.setMandatory("your_field_name",true);
if there are different fields, then you can write a client script on submit and check like below
if(g_form.getValue("field1")=='' || g_form.getValue("field2")=='' || g_form.getValue("field3")=='' || g_form.getValue("field4")=='') {
g_form.addErrorMessage("please select atleast 1 value");
}
Mark the comment as a correct answer and also helpful once worked.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-05-2019 09:13 AM
Asifnoor,
I just went to grab some lunch but I will try this solution once I get back to my desk.
Thanks,
Terry Carter

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-05-2019 10:15 AM
Asifnoor,
I tried your code above but I guess I'm missing something since I'm not that fluent in java scripting.
Getting the error messages below for line #3:
Expected an identifier and instead saw '||'. | |
3 | Expected an assignment or function call and instead saw an expression. |
3 | Missing semicolon. |
3 | Expected an assignment or function call and instead saw an expression. |
3 | Missing semicolon. |
3 | Expected an identifier and instead saw ')'. |
3 | Expected an operator and instead saw '||'. |
3 | Expected an assignment or function call and instead saw an expression. |
3 | Missing semicolon. |
3 | Expected an assignment or function call and instead saw an expression. |
3 | Missing semicolon. |
3 | Expected an identifier and instead saw ')'. |
3 | Expected an assignment or function call and instead saw an expression. |
3 | Missing semicolon. |

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-05-2019 10:54 AM
Hi,
Try like below.
if(g_form.getValue("customer") == "" || g_form.getValue("non_customer") == "" || g_form.getValue("team_member") == "" || g_form.getValue("vendor") == "" || g_form.getValue("other") == "" ) {
g_form.addErrorMessage("Please select atleast 1 checkbox");
}
Mark the comment as a correct answer and also helpful once worked.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-05-2019 11:04 AM