javascript issues with firefox and Netscape are common, but my problem is unique..
I have a "Search" image in my page which calls a javascript function. The problem is that there is absolutely no response when I click the image.. None of the code executes, and the image behaves as if it is a text field. There is no problem if I use IE. It does not work in Netscape either.. Can anyone fix this problem?
Code:
<img src="images/buttons/search_orange.gif" width="45" height="22" alt="" border="0" onclick="null_check()">
<script language="javascript">
function null_check()
{
var city_id=document.search_form.city_id;
var product=document.search_form.product;
if ((city_id.selectedIndex==0))
{
alert("Please Enter your City Name")
city_id.focus();
return false
}
if (search_form.product.value=="Product")
{
alert("Please Enter Product or Clear the field to continue with the search")
search_form.product.focus();
return false
}
search_form.action="HydBiz/search";
search_form.submit();
}
</script>
edited to make code more readable - Brad