I'm working on a project which includes some JQuery and AJAX. I have also implemented a feature of JQuery autofill. The code of form is shown below:
<form class="form-horizontal">
<div class="form-group">
<label for="polciynumber" class="col-sm-2 control-label">Please Enter Policy Number:</label>
<div class="col-sm-4 ui-widget">
<input id="endtpolnumber" type="text" class="form-control col-sm-1" name="endtpolnumber" placeholder="Plase Enter Policy Number">
<button id="findpolinfo" class="btn btn-primary col-sm-3">Find Policy</button>
</div>
<label for="insuredsname" class="col-sm-2 control-label">Department:</label>
<div class="col-sm-4">
<input type="text" class="form-control" id="endtdept" name="endtdept" placeholder="" disabled="disabled">
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-3 col-sm-9">
<button class="btn btn-primary" id="addendt">Add Endorsement</button>
<button class="btn btn-warning" id="addendtclearform">Clear Form</button>
</div>
</div>
</form>
The Autofill is implemented on the textbox with ID "endtpolnumber". When I click on textbox with ID "findpolinfo" it should alert "asdf". But, on contrary it is redirecting me to to this URL
"http://localhost/dis/home/login?endtpolnumber=31-125&endtefffrom=&endtno=&endtamt=&endtdesc="
My JQuery code is as below:
$('#findpolinfo').click(function () {
alert('asdf');
});
Does anyone have any idea, where am i going wrong?
All positive suggestions are welcomed...
Thanks in advance...