Wednesday, November 17, 2010

JQuery dropdownlist enable disable

It is used to set value of the dropdownlist to 0 and Enable/disable using Jquery::

$("#<%= ddlZone.ClientID %>").val("0");
$("#<%= ddlZone.ClientID %>").attr("disabled", false);

//%= ddlState.ClientID %> it will come after the #

$("#<%= ddlState.ClientID %>").val("0");
$("#<%= ddlState.ClientID %>").attr("disabled", true);

$("#<%= ddlDistrict.ClientID %>").val("0");
$("#<%= ddlDistrict.ClientID %>").attr("disabled", true);

$("#<%= ddlCity.ClientID %>").val("0");
$("#<%= ddlCity.ClientID %>").attr("disabled", true);

Using Javascript Enable disable Validator ::

var reqLocation = document.getElementById("<%=reqLocation.ClientID %>");
ValidatorEnable(reqLocation, false);

No comments:

Post a Comment