473,325 Members | 2,870 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

MAC, Safari, Javascript does not run

This script does not run on MAC OS 10 w/Safari, but it does run under XP w/IE. This is a report setup screen. The user selects a customer from a select window and picks a date range from a popup calendar.

The problem is in the validation routine that checks for proper setup before continuing. When the user clicks on Continue image button, the form does not submit. I would appreciate any education passed along. I want to write code that runs everywhere. Thank you.

Expand|Select|Wrap|Line Numbers
  1. <head>  
  2. <script language='JavaScript' type='text/javascript'> 
  3.    function IsComplete(theForm) { 
  4.       if (theForm.m_DATE_BEGIN.value == "")  
  5.       {alert("Beginning Date required.");return false;}  
  6.       else if (theForm.m_DATE_END.value == "")  
  7.       {alert("Ending Date required.");return false;}  
  8.       else 
  9.       {return true;} 
  10.    } 
  11.  
  12.    function  NotEmptySelect(theForm) {
  13.       var oCustomer = theForm.m_ID_CUSTOME; 
  14.       var lCustomer = false; 
  15.       for( var i=0; i<oCustomer.length;i++)  
  16.       { 
  17.          if (oCustomer.options[i].selected) {lCustomer = true;}")
  18.       } 
  19.       if (lCustomer==true) { return true; }  
  20.       else {alert('Pick a Customer'); return false; } 
  21.    } 
  22. </script> 
  23. </head> 
  24. <body>
  25. ...           
  26. <input type="image" 
  27.           src="/images/btn_continue.gif"
  28.           onclick="if( NotEmptySelect(document.getElementById('fS')) && IsComplete(document.getElementById('fS')) )
  29.              {javascript:document.getElementById('fS').submit();}">
Aug 31 '06 #1
1 3231
acoder
16,027 Expert Mod 8TB
On line 17, remove ") at the end of the line.

No need for "javascript:" in the onclick.

The script language attribute is deprecated, so you can safely remove it.
May 12 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Bernard | last post by:
Hi, I am suddenly getting Safari script errors with the following user agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/125.2 (KHTML, like Gecko) Safari/125.8 In a...
8
by: Giuseppe Chielli | last post by:
Hi to everyone? Can someone tell me if there is a way to identify Safari...I found out that navigator.appName returns "Netscape" and I didn't found any option to change the browser's definition......
1
by: aquimr | last post by:
Hi, I'm using input hidden control's value in the javascript function. same code is working fine on all other browser except a specific version of safari(i.e.: MAC OS 10.3.7 and Safari 1.2.4)....
3
by: Joe Cox | last post by:
I am having a problem with style properties for dynamic images in Mac OS X Safari. By dymanic images, I mean images allocated with the javascript 'new Image()' call. With static images (created...
1
by: OtisUsenet | last post by:
Hi, I have a bookmarklet that works perfectly in Firefox, IE, Konqueror, and Opera, but in Safari 2.0.3 (417.9.2) it doesn't work. I enabled debugging and I can see "TypeError - Undefined...
21
by: Edward | last post by:
Hi All, I feel frustrated with one of my Customers who wants me to ensure that a dotnet web site I am building for them must be compatible to Apple's Safari browser! Safari is buggy and it...
7
by: Tom | last post by:
I have an oo-type javascript program running perfectly on IE 6.0+, FF 1.5+, and Opera 7+ on Windows 98+, Linux (RH 9, FC 6), and Mac OS X. 4. As usual, the Safari browser is not working correctly,...
2
by: Andrew Poulos | last post by:
Testing locally on an Win XP box with the safari pop up blocker disabled: window.close(); will close the window without warning even though the window was not opened by javascript. win =...
15
by: GinnTech | last post by:
I have a site that works perfectly in IE6 IE7 FF2 FF3 but not in the latest Safari. Here is the issue. I am attempting to call functions within a flash object. When trying to attempt to...
2
by: rudiedirkx | last post by:
Gents, I have a problem (only in Safari) with the onsubmit in webforms. This topic covers the same subject: http://bytes.com/topic/javascript/answers/166542-onsubmit-safari but not as detailed as...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.