0

i have two checkboxes.

<asp:CheckBox ID="chkPODPrice" Text="Enable POD" runat="server" OnClick="JavaScript:EnableDisable(this);"/>

<asp:CheckBox ID="chckPurchaseEnabel" Text="Enable Buy" runat="server" ClientIDMode="Static" />

if 1st text box is checked , i need to check the other one too and i am doing this on click function but its not working. Help me out.

javascript function is

function EnableDisable(obj) {

    if (obj.checked) {

        $("#chckPurchaseEnabel").checked = true;
    } else {

    }
}
Awais Alvi
  • 29
  • 1
  • 8

1 Answers1

0

You want to set the attribute as below.

$("#chckPurchaseEnabel").attr('checked', true);

Example Fiddle: https://jsfiddle.net/x1aw734b/

Chance
  • 172
  • 1
  • 13