|
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 |
quote |
‽
|
I could be wrong, but doesn't the function have to be defined before it's called?
|
quote |
|
yes, in the code the function is defined before it's called.. I pasted the function code after the call so that the function call is clearly visible in the post.
|
quote |
Senior Member
|
Code:
search_form.action="HydBiz/search";
search_form.submit(); I'm no JavaScript whiz, but shouldn't "document." be proceeding the "search_form"? |
quote |
Posting Rules | Navigation |
|
Thread Tools | |
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
JavaScript not working in FireFox, IE and Safari OK | EmC | Programmer's Nook | 8 | 2006-04-11 22:58 |
Text of second conversation with 'HelpDesk'.. | scratt | General Discussion | 14 | 2006-01-06 22:05 |
Firefox for Mac: User Interface Grievances | Brad | Third-Party Products | 33 | 2005-05-26 16:45 |