DataAssist Search Page Multi Submit Buttons
Hello,
I have a DataAssist Search page i created with a dropdown box and I am viewing the results on the same page. I needed to modify the code to have 2 buttons on the form. 1 to display the results ( on the same page as the dropdown search box) the other to send the varaible to a export page that allows my client to export the selected database into a excel spreadsheet. I have everything working fine except the search page is not refreshing the results after i choose from the dropdown box.
I am using the Javascript below to activate the two buttons.
<script language="Javascript">
function OnButton1()
{
document.bListSearch.action = "search.php"
document.bListSearch.submit(); // Submit the page
return true;
}
function OnButton2()
{
document.bListSearch.action = "export.php"
document.bListSearch.submit(); // Submit the page
return true;
}
</script>
Here is the form....
<form name="bListSearch" method="post">
<table cellpadding="2" cellspacing="0" border="0">
<tr>
<td align="right"><label for="birthdayMonth">Keywords</label></td>
<td><select name="birthdayMonth">
<option>All</option>
<option value="June">June</option>
<option value="August">August</option>
</select></td>
</tr>
<tr>
<td align="center" colspan="2">
<INPUT type="button" value="Submit" name=button1 onclick="return OnButton1();">
<INPUT type="button" value="Export" name=button2 onclick="return OnButton2();">
</td>
</tr>
</table>
Any help would be appreciated