Checkbox is set to disable 9 fields when checked but one field is disable when the document opens
if (event.target.value == "Off") //Checkbox "I will not be using air travel"
{
this.getField("air-noptoTravelOut:date").readonly=false
this.getField("air-noptoTravelReturn:date").readonly=false
this.getField("nopto-airfareCost").readonly=false
this.getField("attach-flightNopto").readonly=false
this.getField("air-ptoTravelOut:date").readonly=false
this.getField("air-ptoTravelReturn:date").readonly=false
this.getField("pto-airfareCost").readonly=false
this.getField("attach-flighPto").readonly=false
}
else
{
this.getField("air-noptoTravelOut:date").readonly = true;
this.getField("air-noptoTravelReturn:date").readonly=true;
this.getField("nopto-airfareCost").readonly=true;
this.getField("attach-flightNopto").readonly=true;
this.getField("air-ptoTravelOut:date").readonly=true;
this.getField("air-ptoTravelReturn:date").readonly=true;
this.getField("pto-airfareCost").readonly=true;
this.getField("attach-flightPto").readonly=true;
}I am designing a form where the are multiple sections. In one section, there is a checkbox the user can check off to indicate that the section its associated with does not apply to them. I have added MouseUp JavaScript (with the help of this forum) to disable all 9 fields associated with that section when the user checks the box. The defaut unchecked.
The problem comes when the user opens the form. Upon launch, regardless of the default application to hand the PDF, the frist of the nine fields is disabled. The only way I have found to enable that field is to check the box, then uncheck it. My thought is to add JavaScript to check the box, then uncheck it immediately upon opening it, but that feels like a bad way to handle it.
Any ideas on how to deal with this, and if the solution I just proposed is the way to do it, how to apply JS to run at launch?
i have provided the only JS code I have in the document at this point.
