Thursday, 27 June 2013

get checkbox checked value in MVC3

View:
@Html.CheckBox("Make it as subfolder", false, new { onchange = "addSubFolder();", id = "chkSubFolder" })

Jquery:
function addSubFolder() {
    debugger;
    var val = $("#chkSubFolder").is(":checked") ? true : false;
    $('#dialogBox').focus();
    if (val == true) {
        $('#drpSubFolder').show();
        //alert('selected');
    }
    else if (val == false) {
        $('#drpSubFolder').hide();
        //alert('un checked');       
    }
}

No comments:

Post a Comment