The reason is that you are only checking on document ready. You need to add a check when the check is clicked as well:

$(document).ready(function(){
$("input#list-one-subscribe").click(function() {
if ($(this).is(":checked")){
$("div.blurb").show();
$("label#add-a").show();
}
else {
$("div.blurb").hide();
$("label#add-a").hide();
}
return false;
}).click();
});

This:
  1. Adds a click event handler
  2. The handler looks to see if the input is checked
  3. If it is, the other stuff is displayed
  4. If it isn't the other stuff is hidden
  5. Then fires the click event, to run the check
Blair

On 11/2/06, twothirty <[EMAIL PROTECTED]> wrote:

i'm having a problem with checkbox values (i've read through the discussion
list and it's helped but not enough to get this working).

http://bdm.twothirty.com/

what i want to do is this:
IF checkbox is checked, it shows div.blurb for the blurb underneath the
checkbox, as well as it shows some additional fields. right now it sort of
works if you check a box, and hit refresh, but it does not work without a
page reload.

ideas? suggestions?
--
View this message in context: http://www.nabble.com/when-checkbox-is-checked-tf2556804.html#a7125215
Sent from the JQuery mailing list archive at Nabble.com.


_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to