h8ids
05-01-2007, 07:19 PM
Calling the this function from "form99", which is located on another page.
The code:
function resultChooser(form99){
if (form99.searchstring != "")
{
form99.action="searchBool.php";
}
else
{
form99.action="searchBool_all.php";
}
}
I know the function is being acted upon. But only the first half of the If... Else statement seems to be recognized.
The default value of the textfield is null. So it should call the "searchBool_all.php" page if nothing is entered into the textfield.
Form code:
<form method="POST" name="form99" onsubmit="resultChooser(this);">
<table>
<tr>
<td>Searching by:</td>
<td>Insert search criteria. (Leave blank to view all records.)</td>
</tr>
<tr>
<td>Course title</td>
<td><input type="text" name="searchstring" value=""></td>
</tr>
</table>
<div style="position: absolute; left: 60px; top: 80px; width:255px;>
<input type="submit" value="Submit" name="B1">
<input type="reset" value="Reset" name="B2">
</div>
</form>
The code:
function resultChooser(form99){
if (form99.searchstring != "")
{
form99.action="searchBool.php";
}
else
{
form99.action="searchBool_all.php";
}
}
I know the function is being acted upon. But only the first half of the If... Else statement seems to be recognized.
The default value of the textfield is null. So it should call the "searchBool_all.php" page if nothing is entered into the textfield.
Form code:
<form method="POST" name="form99" onsubmit="resultChooser(this);">
<table>
<tr>
<td>Searching by:</td>
<td>Insert search criteria. (Leave blank to view all records.)</td>
</tr>
<tr>
<td>Course title</td>
<td><input type="text" name="searchstring" value=""></td>
</tr>
</table>
<div style="position: absolute; left: 60px; top: 80px; width:255px;>
<input type="submit" value="Submit" name="B1">
<input type="reset" value="Reset" name="B2">
</div>
</form>