Manually unselect a checkbox
Hello!
I have checkboxes that when selected populate on another part of my document in the order the checkbox was selected. Here is the JavaScript I am using:
if(event.target.value!="Off")
{
if(!this.getField("1").value)
{this.getField("1").value="• We reviewed and delivered your XXX."}else
if(!this.getField("2").value)
{this.getField("2").value="• We reviewed and delivered your XXX."}else
if(!this.getField("3").value)
{this.getField("3").value="• We reviewed and delivered your XXX."}else
if(!this.getField("4").value)
{this.getField("4").value="• We reviewed and delivered your XXX."}else
if(!this.getField("5").value)
{this.getField("5").value="• We reviewed and delivered your XXX."}else
if(!this.getField("6").value)
{this.getField("6").value="• We reviewed and delivered your XXX."}else
if(!this.getField("7").value)
{this.getField("7").value="• We reviewed and delivered your XXX."}else
{this.getField("8").value="• We reviewed and delivered your XXX."}
}
I have a reset button that when selected unchecks all the items in that section. However, is it possible that if a specific checkbox is unselected manually, that it will unselect in the area I've designated for it to appear?
I added the following mouse up JavaScript to one checkbox field (to test) as an addition to the JavaScript above, but it did not work. I used the following:
if (this.getField("Check Box1").value == "Yes") {
this.getField("Check Box1").display = display.visible;
} else {
this.getField("Check Box1").display = display.hidden;
}
The JavaScript removed the entire checkbox instead of removing the contents of the checkbox in its designated area.
When I deleted the JavaScript, my checkbox field did not return. When I am in Prepare Form, I can see the checkbox. When I preview my document, it disappears.
I am new to JavaScript. Can someone please help me solve?
Thank you so much for your help!
