May 2003
Beginner
624 pages
15h 47m
English
| Q1: | I want to create a textbox that allows the user to enter only a certain type of input, such as numbers. How can I do this? |
| A1: | In the BMI calculator example we examined in the previous hour, the user was prompted for weight and height. Clearly, these inputs must be numeric ones. As we saw, if the user enters some input like “Fred” as weight, it breaks the BMI calculator.
Therefore, you might think that an ideal solution would be to create a textbox into which the user can enter numbers only. Such masked textboxes, as they are called, are rarely, if ever, used on Web pages for a number of reasons. First, while a masked textbox would prevent the user from entering something like “Fred” as weight, it would not prevent the user from entering ... |
Read now
Unlock full access