I have developed a form with 2 required text fields and 8 required radio button fields. Through the help of this website I have the radio buttons working to send an alert if the fields are not completed but can't for the life of me figure out how to do the same with the text fields. I thought appending the if statement would work (after naming the text fields activity1 and activity2 and adding them to the script) but I can't get it to. Below is my script, any help would be much appreciated. I'm sure it's probably just another line or so but have been looking at this for a few days now and my eyes are beginning to cross. Thanks!
var aReqFields = new Array("activity3", "activity4", "activity5", "activity6", "activity7", "activity8", "activity9", "activity10");
var fld;
var nActivityCount = 0; // clear count
for(var i = 0;i < aReqFields.length; i++) {
fld = this.getField(aReqFields[i]);
if(fld.value != "Off" )
nActivityCount++;
}
if(nActivityCount > 7)
Print(true);
else
app.alert({
cMsg:"You have omitted one or more required fields. Click the CANCEL button to cancel printing. Complete all required fields and then click PRINT
Form your starting script, one could modify it as follows:
George Kaiser