checkbox status

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
thatsme
Forum Commoner
Posts: 87
Joined: Sat Apr 07, 2007 2:18 am

checkbox status

Post by thatsme »

Hello,

Code: Select all

 
<script languague='javascript'>
function Test(status)
{
  alert(status);
 
  //in IE i am getting the correct status values (true or false).  In firefox, i am getting alert as undefined.
}
</script>
 
<input type='checkbox' name='check' value='1' onClick='Test(this.status);'>
 
 
in IE i am getting the correct status values (true or false). In firefox, i am getting alert as undefined.
Thanks
thatsme
Forum Commoner
Posts: 87
Joined: Sat Apr 07, 2007 2:18 am

Re: checkbox status

Post by thatsme »

Got it. It should have been,

Code: Select all

this.checked
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Re: checkbox status

Post by pickle »

Please wrap your javascript code in [syntax=javascript][/syntax] tags.
Also, if your problem is solved, please modify your original post and put [solved] in the subject line.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
Post Reply