Skip to main content
Participant
February 6, 2021
Question

Checkbox - Select "None" other boxes uncheck, Check another box and "None" unselects

  • February 6, 2021
  • 2 replies
  • 934 views

Setting up a fillable form to obtain information for a possible home sales listing. The information involves the question have you had an insurance claim? The boxes to check are None, Roof, Water, Fire, Other (followed by a text box to write in). I want them to be able to select None and the other boxes are unvhecked OR if they check one of the other boxes (i.e., roof) then None unchecks. I can do the Yes/No but do not know how to apply this to this situation of multiple boxes. All the boxes besides None can be checked in this example, just if None is checked the others cannot be checked without None unchecking.

 

Help Please!!

 

This topic has been closed for replies.

2 replies

Nesa Nurani
Community Expert
Community Expert
February 8, 2021

In "None" checkbox -> Mouse UP -> Run Javascript add this code:

if(event.target.value != "Off"){
this.getField("Roof").value = "Off";
this.getField("Water").value = "Off";
this.getField("Fire").value = "Off";
this.getField("Other").value = "Off";}

 

In all others checkboxes add this code:

if(event.target.value != "Off"){
this.getField("None").value = "Off";}

 

Inspiring
February 6, 2021

It's easy to do it but in your post you are contradicting yourself, first you say if 'None' is checked others are unchecked or if others are checked 'None ' is unchecked, and at the and you say if 'None' is checked others can't be checked that is contradicting.

You can set script in 'None' checkbox to make read only other checkboxes when checked  and make them not read only when unchecked but that would mean they can't be checked until 'None' is unchecked, But first you need to decide what you want to do.

Participant
February 6, 2021
I appreciate your trying to help, Thank You. I realize that I'm probably
contradicting myself so let me (hopefully) straighten it out. Below is a
screen shot of the line in the fillable form I'm referring to.
[image: image.png]

What I want to do is ensure that if a prospective client checks "None" then
the remaining boxes Roof, Water, Fire, Other are not inadvertently checked
also. Likewise, if they checked None and then said Oh, wait we had a
lightning strike 5 years ago (Other and they'd then write in Lightning
strike) the None box could not be checked.

Restating: if None is checked the others cannot be checked and if one of
the others is checked none is cleared.

Does that help?

Carl
Inspiring
February 6, 2021

Actually you are contradicting it again.

Restating: if None is checked the others cannot be checked and if one of
the others is checked none is cleared.

If others can't be checked when 'None' is checked, how will you check other to clear 'None'?