[jQuery] Checked input box

2006-09-06 Thread David Gironella








I can check a chekckbox input



Something that it

input type=checkbox id=mycheck



$(#mycheck).checked(); and return true
or false



Thk.

Giro.






___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Checked input box

2006-09-06 Thread Dylan Verheul
$('#mycheck').attr(checked)

On 9/6/06, David Gironella [EMAIL PROTECTED] wrote:

 I can check a chekckbox input

 Something that it

 input type=checkbox id=mycheck

 $('#mycheck').checked(); and return true or false

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Checked input box

2006-09-06 Thread Mike Alsup
 This always return to me null, if checkbox is checked or not.

Try this:

$('#mycheck')[0].checked

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Checked input box

2006-09-06 Thread Dylan Verheul
You're right, but it should work.

Anyone else?

js:
$(#bar).click(function() {
var checked = $(#foo).attr(checked);
$(#foo).attr(checked, !checked);
});

html:
input id=foo type=checkbox value=OK / input id=bar
type=button value=Test /

result:
first click of the button sets the checkbox to checked, next clicks it
remains checked.

On 9/6/06, David Gironella [EMAIL PROTECTED] wrote:
 This always return to me null, if checkbox is checked or not.

 Giro.

 -Mensaje original-
 De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] En nombre
 de Dylan Verheul
 Enviado el: miércoles, 06 de septiembre de 2006 14:42
 Para: jQuery Discussion.
 Asunto: Re: [jQuery] Checked input box

 $('#mycheck').attr(checked)

 On 9/6/06, David Gironella [EMAIL PROTECTED] wrote:
 
  I can check a chekckbox input
 
  Something that it
 
  input type=checkbox id=mycheck
 
  $('#mycheck').checked(); and return true or false

 ___
 jQuery mailing list
 discuss@jquery.com
 http://jquery.com/discuss/


 ___
 jQuery mailing list
 discuss@jquery.com
 http://jquery.com/discuss/


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Checked input box

2006-09-06 Thread Klaus Hartl
try

$('#mycheck')[0].checked

checked is one of those attributes that won't work well with 
getAttribute and setAttribute cross browser.


-- Klaus



David Gironella schrieb:
 This always return to me null, if checkbox is checked or not.
 
 Giro.
 
 -Mensaje original-
 De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] En nombre
 de Dylan Verheul
 Enviado el: miércoles, 06 de septiembre de 2006 14:42
 Para: jQuery Discussion.
 Asunto: Re: [jQuery] Checked input box
 
 $('#mycheck').attr(checked)
 
 On 9/6/06, David Gironella [EMAIL PROTECTED] wrote:
 I can check a chekckbox input

 Something that it

 input type=checkbox id=mycheck

 $('#mycheck').checked(); and return true or false
 
 ___
 jQuery mailing list
 discuss@jquery.com
 http://jquery.com/discuss/
 
 
 ___
 jQuery mailing list
 discuss@jquery.com
 http://jquery.com/discuss/
 

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Checked input box

2006-09-06 Thread David Gironella
Yes, this work.

Thk.
Giro.

-Mensaje original-
De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] En nombre
de Mike Alsup
Enviado el: miércoles, 06 de septiembre de 2006 15:39
Para: jQuery Discussion.
Asunto: Re: [jQuery] Checked input box

 This always return to me null, if checkbox is checked or not.

Try this:

$('#mycheck')[0].checked

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/