How to generate a Radio Button and work with jquery ?


//=========HTML================
 <form id="OperationType" style="display: inline">
        <input type="radio" id="txtInActive" name="InActive" value="1" />Make InActive
        <input type="radio" id="txtBranchSwitch" name="InActive" value="2" />Branch Switch
  </form>

//===========get Value from Control

var InActiveOrBranchSwitch = $("#OperationType input[type='radio']:checked").val();

///OperationType Change Event

    OperationTypeChangeEvent:function() {
        $("#txtBranchSwitch").change(function () {
            if ($("#txtBranchSwitch").attr("checked")) {
                $("#changedCompanyBranchDiv").show();
            }
        });
       
        $("#txtInActive").change(function () {
            if ($("#txtInActive").attr("checked")) {
                $("#changedCompanyBranchDiv").hide();
            }
        });
    }


Clear value :
.......................
  $("input:radio").attr("checked", false);






Post a Comment

0 Comments