User Name
Password
AppleNova Forums » Programmer's Nook »

onclick not working in firefox, but working on IE/netscape


Register Members List Calendar Search FAQ Posting Guidelines
onclick not working in firefox, but working on IE/netscape
Thread Tools
sri_kon
 
 
2006-04-20, 02:19

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
chucker
 
Join Date: May 2004
Location: near Bremen, Germany
Send a message via ICQ to chucker Send a message via AIM to chucker Send a message via MSN to chucker Send a message via Yahoo to chucker Send a message via Skype™ to chucker 
2006-04-20, 02:23

I could be wrong, but doesn't the function have to be defined before it's called?
  quote
sri_kon
 
 
2006-04-20, 02:34

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
rollercoaster375
Senior Member
 
Join Date: Mar 2005
Location: UIllinois (Champaign, IL)
Send a message via AIM to rollercoaster375 Send a message via MSN to rollercoaster375 Send a message via Yahoo to rollercoaster375 Send a message via Skype™ to rollercoaster375 
2006-04-20, 10:13

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
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Post Reply

Forum Jump
Thread Tools
Similar Threads
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


« Previous Thread | Next Thread »

All times are GMT -5. The time now is 17:51.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004 - 2024, AppleNova