Re: isnumberic check
- From: RobG <rgqld@xxxxxxxxxxxx>
- Date: Tue, 28 Aug 2007 16:48:29 -0700
On Aug 28, 11:07 pm, "Richard Maher" <maher...@xxxxxxxxxxxxxxxxxx>
wrote:
Hi Rob,
That must be the worst way to go about it. It has many usability
issues, including preventing decimal numbers, scientific notation,
signs, and so on.
Maybe you're right, maybe Eggie did want scientific notation and was
calculating pie to infinity with a reverse Polish calculator.
The requirement was to check if a string is a number, attempting to
prevent keyboard entry of characters other than 0 to 9 is a bad way to
achieve that.
[...]
Either way, who gives a toss?
The OP, and anyone who discovers this thread looking for something
like "check string is number".
If you present a solution that you know has limitations, best to spell
them out rather than leave it for others to discover by trial and
error. It will often be their users who will need to submit to the
trial and endure the errors.
All I did was offer Egmont an extensible alternative for what he was trying
to do.
Extensible? By adding more character codes I guess. But simply
restricting the characters that can be entered does not ensure a
number will result. If you allow decimal points for decimal numbers,
then 1.2.3 is likely not considered a "number" by most but will be
allowed by your solution.
Your "solution" also prevents the use of backspace or delete to remove
incorrect entries - more keycodes to add. And maybe the user wants to
use the cursor keys too, hey more keycodes. Maybe they also like to
use tab to move to the next field... how many keycodes do you think
you will end up adding just to allow integers and floats?
And at the end of if all, users can completely bypass your scheme by
using copy and paste.
If you choose to censor the material available to him in his fact
gathering
Censor? I don't have the power to do that, and wouldn't if I did.
then I'm obliged to float the possibility that your prejudice and
myopia have you once again talking out of your arse.
Try to get beyond grade 6. Perhaps you'd like to explain your
solution for the usability issues raised above?
--
Rob
.
- References:
- isnumberic check
- From: eggie5@xxxxxxxxx
- Re: isnumberic check
- From: Richard Maher
- Re: isnumberic check
- From: RobG
- Re: isnumberic check
- From: Richard Maher
- isnumberic check
- Prev by Date: How to discover if attachEvent was done to an element
- Next by Date: Re: How to discover if attachEvent was done to an element
- Previous by thread: Re: isnumberic check
- Next by thread: Re: isnumberic check
- Index(es):
Relevant Pages
|
Loading