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
VK - 31 Oct 2005 11:00 GMT
> 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
[quoted text clipped - 5 lines]
> 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.
Mick White - 31 Oct 2005 17:44 GMT
> 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
[quoted text clipped - 5 lines]
> function is pretty basic... in fact, I think I consulted this group to
> develop it.
Works for me, Safari 1.0.3
Mick
Ian Osgood - 31 Oct 2005 21:11 GMT
> > 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
[quoted text clipped - 8 lines]
> Works for me, Safari 1.0.3
> Mick
And me, 1.3.1 (OSX 10.3.9)
Ian
Stephen Chalmers - 31 Oct 2005 21:14 GMT
> 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
[quoted text clipped - 7 lines]
>
> 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.