Friday 12 June 2020

Reset all input value inside a control using jquery

///////////////js


function Reset_Controls(CtrlID_Cls, IsCtrlClass) {
    let ctlrid;
    if (IsCtrlClass) {
        ctlrid = $("." + CtrlID_Cls);
    }
    else {
        ctlrid = $("#" + CtrlID_Cls);
    }
    $(ctlrid).find("input[type=text], textarea").val("");
    $(ctlrid).find("input[type=checkbox]").prop(":checked", false);
    $(ctlrid).find('select').val($('select option').eq(0).val());

    /////// ******************** Set Null for all
    // $(ctlrid).find('select').val($('select').val([]);

    /////// ******************** Set value 0 for all
    //$(ctlrid).find("select").val("0");
}

No comments:

Post a Comment

Excel Sort values in ascending order using function TEXTJOIN

 Excel ::  Text ::  1,3,5,2,9,5,11 Result :: 1,2,3,5,5,9,11 Formula ::     TEXTJOIN ( ",",1,SORT(MID(SUBSTITUTE( A1 ,","...