Hi,
I have always used AJAX with onChange events of Select Controls, or creating dependent Drop Down Boxes.
Now I am faced with another scenario. Users want a search form. Once they select a value in the Select box, they will enter the search values and then click on the submit button to get the search results.
Can I invoke the AJAx funtion with submit buttons?
Kindly give me suggestions what I should do to implement AJAX with submit buttons.
I am trying a small example first with Northwind.
Here is my code:
Thanks.
I have always used AJAX with onChange events of Select Controls, or creating dependent Drop Down Boxes.
Now I am faced with another scenario. Users want a search form. Once they select a value in the Select box, they will enter the search values and then click on the submit button to get the search results.
Can I invoke the AJAx funtion with submit buttons?
Kindly give me suggestions what I should do to implement AJAX with submit buttons.
I am trying a small example first with Northwind.
Here is my code:
Code:
<form name="formSearch" method="post" action="getNorthwind.asp">
<div class="Container">
<label>Search Criteria: </label>
<select name="SearchCriteria" onchange="togDisplay(this.value)">
<option value="">- Select -</option>
<option value="CompanyName">Company Name</option>
<option value="ContactName">Contact Name</option>
<option value="ContactTitle">Contact Title</option>
</select><br />
<div id="dCompanyName" style="display:none">
<label>Company Name: </label>
<input type="text" name="CompanyName" /><br />
</div>
<div id="dContactName" style="display:none">
<label>Contact Name: </label>
<input type="text" name="ContactName" /><br />
</div>
<div id="dContactTitle" style="display:none">
<label>Contact Title: </label>
<input type="text" name="ContactTitle" /><br />
</div>
<label></label>
<input type="submit" value=" Search " />
</div>
</form>
Thanks.