Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

change checkbox jquery alert

$(document).ready(function() {
    //set initial state.
    $('#textbox1').val(this.checked);

    $('#checkbox1').change(function() {
        if(this.checked) {
            var returnVal = confirm("Are you sure?");
            $(this).prop("checked", returnVal);
        }
        $('#textbox1').val(this.checked);        
    });
});
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #change #checkbox #jquery #alert
ADD COMMENT
Topic
Name
3+8 =