[jQuery] Re: both 'if' and 'else' blocks being executed

2009-07-13 Thread Matt Zagrabelny
On Fri, 2009-07-10 at 23:51 +0200, Massimo Lombardo wrote: Please, using plain English only, explain what you want to do. Then we'll try to help ;) Alright. The glitch is probably caused by the fact that the two input fields *do* share the same name; then when you touch one, you *do* alter

[jQuery] Re: both 'if' and 'else' blocks being executed

2009-07-13 Thread Peter Edwards
Hi Matt, The if and else blocks are not both being executed. try this: $(function(){ $('#billable_checkbox').change(function(event){ if (this.checked) { $('#billable_hidden').attr(disabled, disabled); } else { $('#billable_hidden').removeAttr(disabled); } }); }); The

[jQuery] Re: both 'if' and 'else' blocks being executed

2009-07-13 Thread Michael Geary
From: Matt Zagrabelny My main question is how does both the 'if' block and the 'else' block get executed in the same pass through the function? I haven't been following the thread in detail, but the simple answer to that question is they don't, and they can't. Fundamental JavaScript

[jQuery] Re: both 'if' and 'else' blocks being executed

2009-07-10 Thread Matthew
Can you explain to me why you are disabling a hidden input field? I assume the idea is that they are both checkboxes with the the same name attribute. Maybe I could help if I understood why you are doing this. On Jul 10, 1:38 pm, Matt Zagrabelny mzagr...@d.umn.edu wrote: Greetings, I am

[jQuery] Re: both 'if' and 'else' blocks being executed

2009-07-10 Thread Matt Zagrabelny
On Fri, 2009-07-10 at 14:40 -0700, Matthew wrote: Can you explain to me why you are disabling a hidden input field? I assume the idea is that they are both checkboxes with the the same name attribute. Maybe I could help if I understood why you are doing this. The form handler on the server

[jQuery] Re: both 'if' and 'else' blocks being executed

2009-07-10 Thread Matthew
Depending on how your serverside processing works it makes sense that it would process both. Doesn't disable just prevent a client-side user from changing the checkbox? Make when the user check the check you can add or remove the desired checkbox using:

[jQuery] Re: both 'if' and 'else' blocks being executed

2009-07-10 Thread Matthew
Depending on how your serverside processing works it makes sense that it would process both. Doesn't disable just prevent a client-side user from changing the checkbox? Make when the user check the check you can add or remove the desired checkbox using:

[jQuery] Re: both 'if' and 'else' blocks being executed

2009-07-10 Thread Massimo Lombardo
Please, using plain English only, explain what you want to do. Then we'll try to help ;) The glitch is probably caused by the fact that the two input fields *do* share the same name; then when you touch one, you *do* alter both! Bug or feature? As far as I got it, (and pretending that I got it

[jQuery] Re: both 'if' and 'else' blocks being executed

2009-07-10 Thread Brett Ritter
On Fri, Jul 10, 2009 at 6:09 PM, Matthewmvbo...@gmail.com wrote: Depending on how your serverside processing works it makes sense that it would process both. Doesn't disable just prevent a client-side user from changing the checkbox? Disable instructs the browser not to send it. Readonly