gerkintrigg Posted November 25, 2009 Share Posted November 25, 2009 I set the checkbox to have a checked value of "y" and I want to set the form to post the value as a variable to a javascript script. I'm trying this: onclick(checkbox(my_box.value)) but it just says "undefined". Is there an easy way to make it say "n"? Even when it is checked, it still says undefined so perhaps I'm being dumb... though it is very late here. Quote Link to comment Share on other sites More sharing options...
Viola Posted November 25, 2009 Share Posted November 25, 2009 If a checkbox is checked, the value is posted, otherwise it is not. You would need to say something like if checkbox value is empty then cbxValue = 'n'; else cbxValue = checkbox value; then use cbxValue. Quote Link to comment Share on other sites More sharing options...
gerkintrigg Posted November 25, 2009 Author Share Posted November 25, 2009 yeah, that's what i figured... damn. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.