[jQuery] Getting checked/disabled Attributes using attr()

2007-03-12 Thread Michael E. Carluen
Hello all, I am trying to get the checked or disabled attributes from input type=checkbox and a input type=submit using attr() but with no success. What I am trying to do is control both elements together so I can disable the submit button if a specified checkbox is unchecked. Suggestions

Re: [jQuery] Getting checked/disabled Attributes using attr()

2007-03-12 Thread Erik Beeson
Assuming your checkbox is called 'cb' and your submit button is called 'sub', try this: $(function() { $('#cb').click(function() { if($(this).is(':checked')) { $('#sub').removeAttr('disabled'); } else {

Re: [jQuery] Getting checked/disabled Attributes using attr()

2007-03-12 Thread cf_mecarluen
Sweet! Works like a charm- thank you very much, Erik. Michael -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Erik Beeson Sent: Monday, March 12, 2007 2:23 PM To: jQuery Discussion. Subject: Re: [jQuery] Getting checked/disabled Attributes using