tags:

views:

17

answers:

1

Hi

I have a checkbox and I am using jquery. I want to popup a dialog box when a user checks the checkbox. However if they uncheck the box nothing should popup.

How can I do this? Also I need to use jquery live or livequery as the checkbox is not displayed on page load.

+2  A: 
$('#checkbox').live('change', function(){
    if($(this).is(':checked')){
        popUpFunction();
    }
});
antpaw
Hmm so you can't make a selector that only binds to checked checkboxes?
chobo2
sure you can $('input[type="checkbox"]:checked') but this doesnt make sens to me, because checkboxes can change their status.
antpaw