RE: [PHP] limit form input digits
| From: | Gavin Nouwens | Date: | Wed, 07 May 2003 12:37:20 +0000 |
| Subject: | RE: [PHP] limit form input digits | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-146657@lists.php.net to get a copy of this message | ||
In the HTML form did you set the size to 2 or the maxlength?
Maxlength is the one that limits the number of chars for a field.
-gav.
| -----Original Message-----
| From: Malcolm [mailto:malcolm@mbrownell.com]
| Sent: Wednesday, 7 May 2003 10:17 PM
| To: php-general@lists.php.net
| Subject: [PHP] limit form input digits
|
|
|
|
| Hello All,
|
| I'm trying to limit to 99 the amount of times this prints ;
|
| if (ereg ("([^0-9]{2})", $incre)) {
| echo "bad input";
| } else {
| echo "Printing now ...<br>";
| }
|
| Reading the manual and the comments I thought the {2} would do that,
| but it doesn't. I have set the form field size to two but that isn't
| working
| either, you can still put more than two numbers in the field
| even though
| they don't show. The {2} does keep letters out but how can I
| limit the
| input to two digits ?
|
| --
| PHP General Mailing List (http://www.php.net/)
| To unsubscribe, visit: http://www.php.net/unsub.php
|