I can find no problem what so ever with your code.
--
I told you this was going to happen.
I think I know what the problem is.
Hope that helped.
- Conrad
PS: Are the posts getting more and more bizarre in this group?
http://fipco.com/products/hard_copy_order.php
The very first thing that happens when you start typing in one of the
quantity fields is a JavaScript error "numbersonly is not defined". You
must have noticed this error, since it occurs in FF3 too, and you tested
with this browser (assuming "Mozilla 3.0" refers to Firefox 3).
As for the rest, please enter your URL here and you'll see a host of
other problems with this page: http://validator.w3.org/
- Conrad
You ain't seen nothin' yet ;-)
Regards,
PointedEars
--
Use any version of Microsoft Frontpage to create your site.
(This won't prevent people from viewing your source, but no one
will want to steal it.)
-- from <http://www.vortex-webdesign.com/help/hidesource.htm>
LOL
Maybe:
function shiftValueUpTo10(input) {
var val = parseInt(input.value, 10);
// Fix bug for NaN, 0, et c.
if(!val) {
input.value = "";
} else {
input.value = Math.ceil(val/10) * 10;
}
}
Use parseInt with a radix to avoid mishaps with base 8 (octal).
For example, the user might have entered: "08"
That results in the base 8 being used and the result of:
parseInt("08")
- is 0.
Garrett
It seems sensible to validate what the user has entered before using
it, that way parseInt can be ditched entirely, e.g.:
function isInteger(n) {
var re = /^\d+$/;
return re.test(n);
}
function shiftValueUpTo10(input) {
var val = input.value;
input.value = isInteger(val)? ((val/10|0) +1 )*10 : '';
}
--
Rob
Hmm. If value is "0", then value becomes "10".
The user might see this as an unscrupulous way to add unwanted items to
his cart.
>
> --
> Rob
Or useful assistance provided by his or her friendly
(over)supplier. :-)
--
Rob
How do these people get Jobs?
> Use parseInt with a radix to avoid mishaps with base 8 (octal).
IMHO. parseInt and parseFloat should ONLY be used when unary + (or
unary -) would not serve.
--
(c) John Stockton, near London, UK. Posting with Google.
Mail: J.R.""""""""@physics.org or (better) via Home Page at
Web: <URL:http://www.merlyn.demon.co.uk/>
FAQish topics, acronyms, links, etc.; Date, Delphi, JavaScript, ....|