Making textField required when checkbox is ticked
Hi
I am trying to make a textfield(input) become require if checkbox(special) is ticked. I have tried everything I can think of. I believe the problem is with the code for the
checkbox. The submit button works and populates email however it does not check to verify the textbox has something in it if the checkbox is ticked.
Code is on a submit button
var isFormValid = true;
if (this.getField("special").value == 'on' && this.getField("input").value == '')
{
app.alert('Enter Data');
isFormValid = false;
}
else{
if (isFormValid) {
var mySubject = "Leadership Development Request Form for" + " " + this.getField("Name").value + " " + "Circuit" + " " + this.getField("Circuit").value;
this.mailDoc( {
bUI: true, cTo: "email@mail.com", cSubject: mySubject
})
}}
Any assistance will be appreciated
