473,839 Members | 1,328 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

MAC, Safari, Javascript does not run

1 New Member
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 3256
acoder
16,027 Recognized Expert Moderator MVP
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
6018
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 frameset scenario, the framesetting document (top) contains a
8
3792
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... I can use document.all for IE, and so on but what can I do with Safari? I need to distinguish Safari from other browsers... Thanks to everyone.
1
3674
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). problem: control's value is not getting displaying at the first time when the page gets load, although the same piece of code would work if
3
6699
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 with the html <img> tag), I can make the image visible or not, i.e. '<img style="visibility='hidden'" src='xxxx'/>'. But if I create the image dynamically with javascript: new Image() then try to modify the style, Safari chokes, and the Debug...
1
5911
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 value" reported in the Javascript console, but I'm not sure where the error is. The bookmarklet in question is here: javascript:if (parseInt(navigator.appVersion) >= 4) { if
21
4442
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 does not support lots of things (xhtml etcc). However, what puzzles me is that there are some dotnet Framework 2 web sites out there that work perfectly well under Safari, whereas my website does not
7
2559
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, and because it lacks an internal debugger, I'm completely unable to see what the problem is. So I downloaded that "Drosera" debugging program, but I'm finding it useless for the following reasons: 1) I cannot "Attach" it to Safari 2.0...
2
4749
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 = window.open("test.htm","foo");//, str); alert(win); does not open a new window and the value displayed by the alert is "undefined" (shouldn't it be "null" if there was a problem???). Also
15
2677
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 retrieve the object to call the functions IE6 IE7 FF2 FF3 all return Objects to work with. In Safari a function is returned. Here is the code. /
2
4778
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 I will. Let me illustrate the problem with examples. The HTML: <html> <head> <script type="text/javascript" src="/js/mootools_1_11.js"></script>
0
9855
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9697
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10908
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
7829
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7018
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5867
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4487
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4064
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3136
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.