Make a selection mandatory for atleast one checkbox to be selected on a form with alert if nothing selected

Terry Carter Jr
Tera Contributor

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:

find_real_file.png

Any guidance or help is greatly appreciated!

Thanks,

Terry 

1 ACCEPTED SOLUTION

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.

View solution in original post

31 REPLIES 31

Okay the first one didn't work still allowed me to submit.

Trying second solution now.

It seems the second solution worked as it didn't allow me to submit when I clicked on the button.  

find_real_file.png

Perfect, so just place false in double quotes in the earlier if condition and it should work.

Mark the comment as a correct answer and other comment(s) as helpful.

Already placed the double quotes as stated above but now I have a new problem.  Once I do try to select an option or more it will still not allow the submission to be made.  I am still getting the alert message.  😞

find_real_file.png

Also noticed that when I selected all the checkboxes it submitted without any error message so maybe we need to tweak the code again.  

Wow all of this for my security team.