B
Batezz
Why does the following form validation not work?
If both CityTown and County fields are blank then the html should stop and
not go to http://www.XXXXX.COM/Product/Productsearchresults.php.
Any help appreciated
Batezz
<script Language="JavaScript">
<!--
function Blank_TextField_Validator()
{
if (location_search.CityTown.value="")
{ if (location_search.County.value="")
{ return (false);
}
}
return (true);
}
-->
</script>
<body>
<form action="http://www.XXXXX.COM/Product/Productsearchresults.php"
method="get" name="location_search" id="location_search" onsubmit="return
Blank_TextField_Validator()">
<table width="172" border="1">
<tr>
<td colspan="2">Location search</td>
</tr>
<tr>
<td width="64">City/Town</td>
<td width="112"><input name="CityTown" type="text" id="CityTown"
size="15" /></td>
</tr>
<tr>
<td>County</td>
<td><input name="County" type="text" id="County" size="15" /></td>
</tr>
<tr>
<td> </td>
<td><div align="right">
<input type="submit" name="Submit" value="Search" />
</div></td>
</tr>
</table>
</form>
</body>
If both CityTown and County fields are blank then the html should stop and
not go to http://www.XXXXX.COM/Product/Productsearchresults.php.
Any help appreciated
Batezz
<script Language="JavaScript">
<!--
function Blank_TextField_Validator()
{
if (location_search.CityTown.value="")
{ if (location_search.County.value="")
{ return (false);
}
}
return (true);
}
-->
</script>
<body>
<form action="http://www.XXXXX.COM/Product/Productsearchresults.php"
method="get" name="location_search" id="location_search" onsubmit="return
Blank_TextField_Validator()">
<table width="172" border="1">
<tr>
<td colspan="2">Location search</td>
</tr>
<tr>
<td width="64">City/Town</td>
<td width="112"><input name="CityTown" type="text" id="CityTown"
size="15" /></td>
</tr>
<tr>
<td>County</td>
<td><input name="County" type="text" id="County" size="15" /></td>
</tr>
<tr>
<td> </td>
<td><div align="right">
<input type="submit" name="Submit" value="Search" />
</div></td>
</tr>
</table>
</form>
</body>