473,397 Members | 2,028 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,397 software developers and data experts.

safari browser doesn't like my javascript

I'm getting reports (which is all I can go on cause I don't have a mac
or safari browser - new question: can I install safari on a windows
box?) that the javascript at: http://www.perfectlocale.com/standard.php
throws a "you must enter a starting price" alert when using the safari
browser.

Any pro's out there know why that would be the case? The validateForm
function is pretty basic... in fact, I think I consulted this group to
develop it.

Thanks, Greg

Oct 31 '05 #1
4 1620
VK

Greg Scharlemann wrote:
I'm getting reports (which is all I can go on cause I don't have a mac
or safari browser - new question: can I install safari on a windows
box?) that the javascript at: http://www.perfectlocale.com/standard.php
throws a "you must enter a starting price" alert when using the safari
browser.

Any pro's out there know why that would be the case? The validateForm
function is pretty basic... in fact, I think I consulted this group to
develop it.

....
var controls = thisForm.elements;
var minPrice = controls.minPrice;
var maxPrice = controls.maxPrice;
....

Try to change it to:

with (thisForm) {
var minPrice = elements['minPrice'];
var maxPrice = elements['maxPrice'];
}

may help / may not. If still not then try element indexes instead of
names:
var minPrice = document.forms[formIndex].elements[elementIndex];

Safary seems to have rather *custom* ideas what's wrong and what's
right in DOM and scripting.

You cannot install Safary or Safary emulator w/o MacOS, I tried.

Oct 31 '05 #2
Greg Scharlemann wrote:
I'm getting reports (which is all I can go on cause I don't have a mac
or safari browser - new question: can I install safari on a windows
box?) that the javascript at: http://www.perfectlocale.com/standard.php
throws a "you must enter a starting price" alert when using the safari
browser.

Any pro's out there know why that would be the case? The validateForm
function is pretty basic... in fact, I think I consulted this group to
develop it.


Works for me, Safari 1.0.3
Mick
Oct 31 '05 #3

Mick White wrote:
Greg Scharlemann wrote:
I'm getting reports (which is all I can go on cause I don't have a mac
or safari browser - new question: can I install safari on a windows
box?) that the javascript at: http://www.perfectlocale.com/standard.php
throws a "you must enter a starting price" alert when using the safari
browser.

Any pro's out there know why that would be the case? The validateForm
function is pretty basic... in fact, I think I consulted this group to
develop it.


Works for me, Safari 1.0.3
Mick


And me, 1.3.1 (OSX 10.3.9)
Ian

Oct 31 '05 #4
Greg Scharlemann wrote:
I'm getting reports (which is all I can go on cause I don't have a mac
or safari browser - new question: can I install safari on a windows
box?) that the javascript at: http://www.perfectlocale.com/standard.php
throws a "you must enter a starting price" alert when using the safari
browser.

Any pro's out there know why that would be the case? The validateForm
function is pretty basic... in fact, I think I consulted this group to
develop it.

Thanks, Greg


It's not unreasonable for the user to be entering commas, which your
function will fail without any explanatory message.

This modified function strips the input of anything but digits and
commas then checks that any commas are positioned correctly.

The input field is modified to show the value under consideration.

Please not that the parameter to this function must be formElement not
formElement.value as yours uses.

(Watch for line wrap)

function isNumber(n)
{
var str=n.value=n.value.replace(/[^0-9\,]/g,'');

return !( !str.length ||
/^\,|\d{4,}\,|\,\d{4,}|\,\d{0,2}(\D|$)/.test(str) );
}

--
S.C.

Oct 31 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

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...
5
by: Kim Forbes | last post by:
Hi, I realize my first problem is that I'm using browser detection and not feature detection. Maybe someone can help me understand feature detection. This script works in every browser that I...
5
by: joaopedrogoncalves | last post by:
Hi, I want to load an external javascript file, get its results and stick them inside a <div> block. I also want to do this in several places on a web page. This way the browser doesn't have...
2
by: laredotornado | last post by:
Hi, Is it possible to fool Javascript running on a Mac Safari web browser into believing it is a PC IE browser? We have the following JS code that is detecting both Mac and Safari. Sadly, we do...
34
by: Simon Wigzell | last post by:
document...focus() will scroll the form to move the specified text field into view on everything I have tried it with except Safari on the MAC. The form doesn't move. Any work around? Thanks.
4
by: mr.fullzero | last post by:
Our team have extracted code sample that caused abnormal Safari termination. The crash seems to happen any time, when user selects an option and closes alert popup. The version of Safari is 10.4.6....
5
by: Peter Michaux | last post by:
Hi, I just did a bunch of testing and was surprised with the results. If anyone doesn't know this stuff here is what I found about event.clientX. The event.clientX property in Safari is in...
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,...
13
by: Zwerfkat | last post by:
When running the code below, all browsers are showing "Hello World" except Safari which cannot match the regular expression. See also http://www.testabc.nl/safari/test.html When I change *? into...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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...

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.