Problem with simple "if" statement
Hello all,
I'm having trouble with what I think is a simple "If" statement. I'm trying to reset two checkboxes if one checkbox is checked. Here is my code:
<code>
If (this.getField("NoUrinaryProblems").value == "yes") {
this.getField("UninaryProblems").value = "Off";
this.getField("UrinaryPain").value = "Off";
}
</code>
I'm getting an error on line 2 saying missing ; before statement. I'm not a Java expert but I can't seem to see what's wrong, especially because I basically copied the statements from the forum and just changed the names. This is what I have tried:
* If I remove the "if" statement it works, checking the target box (NoUrinaryProblems) unchecks the two other fields no matter what the status of the first checkbox is
* Moved the { to the next line, then I don't get the error but it doesn't work at all
* Experimented with changing the double quotes to single quotes, no effect.
* put a ; after the value == "yes" part
Can anyone tell me what I'm doing wrong here?
Thanks,
stevinga
