I'm new at JQuery and I want to use Jquery Bootstrap validation in my web form to validate the controls.
here is html :
<div class="form-group">
<div class=" col-lg-6">
<label for="txtGroupName" class="req"> نام گروه </label>
<asp:TextBox ID="txtGroupName" CssClass="required form-control text-right" runat="server"></asp:TextBox>
</div>
<div class="col-md-2">
<br />
<asp:Button OnClick="submitbtn_Click" ID="submitbtn" Width="100px" Height="40px" CssClass="btn btn-success submit-btn" runat="server" Text="جستجو" />
</div>
</div>
and :
$(function () {
$('#signinform').validate_popover({ onsubmit: false, popoverPosition: 'top' });
$(".submit-btn").click(function (ev) {
ev.preventDefault();
$('#signinform').validate().form();
return false;
});
$(window).resize(function () {
$.validator.reposition();
});
});
all the things are true and validation is working but when I enter a string value in my textbox (id=txtGroupName) and then click my button (id=submitbtn) the butto click event of this control doesn't occur (OnClick="submitbtn_Click").
If I change this control cssclass like this:
<asp:Button OnClick="submitbtn_Click" ID="submitbtn" Width="100px" Height="40px" CssClass="btn btn-success" runat="server" Text="جستجو" />
the OnClick="submitbtn_Click"
works. What changes do I need in my funnction to trigger OnClick="submitbtn_Click"
after validation?