Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org

Feedback: irt.org FAQ Knowledge Base Q332

Feedback on: irt.org FAQ Knowledge Base Q332

Sent by Bill Wilkinson on August 09, 1999 at 19:52:39: - feedback #357

Worth:
Worth reading

Technical:
Not technical enough

Comments:
The answer to Q332 shows how to pop up an alert when the user enters a non-number to a text box, but it doesn't then do anything to force the user to reenter the data. Obviously, a global flag could be set and checked, but a simple way would be to simply return the numeric value if it is okay or a zero if it is not and then invoke it via

...onChange="this.value=check(this.value);"...







Sent by Josh Hoexter on September 02, 1999 at 19:19:16: - feedback #428

Worth:
Worth reading

Length:
Just right

Technical:
Just right

Comments:
To check for a string that will return NaN when converting to a number:
if (((contents / contents) != 1) && (contents != 0))
will not work if contents is a string containing only spaces. You need something like this:
if ((contents / contents != 1) && (parseFloat(contents) != 0))





©2018 Martin Webb