PDA

View Full Version : [AS2] If Statement on radiobutton


Magnix
10-01-2008, 08:46 PM
Im trying to make the if statement to work on one radiobutton.


if ( yes_servRB.enabled )
{
formData.varYesProServ = "Selected";
}
else
{
formData.varYesProServ = "Unselected";
}


The radiobutton is set false to disable it, and if I click on the radiobutton to enable it, it displays "Selected" on the log.txt, but If I leave it disabled after I hit the submit button, the log.txt STILL shows "Selected" (?????) What did I do wrong with this if statement?

The codes above are outside of the submit button using btnSubmit.onRelease = function ().

Thanks!

kawabuz
10-01-2008, 08:58 PM
I am not sure but I think your if statement needs a boolean variable.

if ( yes_servRB.enabled == true)
{
formData.varYesProServ = "Selected";
}
else
{
formData.varYesProServ = "Unselected";
}

Magnix
10-01-2008, 09:10 PM
I tried your code, it showed "Selected" on log.txt when I left the radiobutton disabled, after I hit the submit button. This is weird as if the if-statement is not very strong and directed.

Any idea?

Thanks!