Javascript question
Hello,
I have three buttons that can potentially be checked on a form i create. I'm close to getting the results to populate in another field but I think because i have 4 different possible outcomes i can't seem to get it right. The bottom line is if checkbox 1 is selected (cb144) then should yield a result R, if checkbox 2 is selected then should yield a result N, if checkbox 3 is selected then should yield a result P and if no box is selected then it should yield nothing in the field. Below is the script i've written and obviously it's not working. Can anyone help me out finishing the following script?
var theField = this.getField("cb144");
var theValue = theField.value;
var theField2 = this.getField("cb145");
var theValue2 = theField2.value;
var theField3 = this.getField("cb146");
var theValue3 = theField3.value;
if (theValue == "Resident") {
this.getField("a14a4").value= "R";
}
if (theValue2 == "Non-Resident") {
this.getField("a14a4").value= "N";
}
if (theValue3 == "Part Year") {
this.getField("a14a4").value= "P";
}
else {
this.getField("a14a4").value= "";
}
