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

How to highlight selected text in notepad++

  –> To highlight a block of code in Notepad++, please do the following steps step-1  :- Select the required text. step-2  :- Right click...