Pages

Friday, September 6, 2013

Useful Jquery syntax

// Checks the count of the checkboxes checked
var n = $("input[type=checkbox]:checked").length;
//Prevents the button submit
$("#btnUpload").click(function (event) { event.bubbles = false; });
//Checks if radio button is checked
$('#radConst_0').is(':checked')
//Checks if check box is checked
$('#chkConst').is(':checked')
// Makes the control disable
$("#divRwkFunctions").attr("disabled", "disabled");
// clears all the checked boxes
var m = $("input[type=checkbox]").removeAttr('checked');
// Select the radio button
$('#ctl00_MainContent_radConst_1').attr('checked', 'checked');
// Adds the click event on all the checkboxes
$("input[type=checkbox]").click(function () {
                chkFunctionStatus();
            });
//Clear the File upload control//For IE
$("#fUpload").replaceWith($("#ctl00_MainContent_fUpload").clone(true));
//For other browsers
$("#fUpload").val("");

No comments:

Post a Comment