$('#btnSubmit').click(function () {
var isValid = true;
$("table[id$='gvPurchase']").find("span.validate").each(function () {
//span use for lable control and validate is class of the control
// <asp:Label ID="Label2" runat="server" class="validate" Text="0"></asp:Label>
if ($(this).html() == "") {
$("#gvValidate").html("*Rate and quantity not be null");
isValid = false;
}
if (parseInt($(this).html()) <= 0) {
$("#gvValidate").html("*Rate and quantity must be grater then zero");
isValid = false;
}
});
No comments:
Post a Comment