[PHP] numerics
IS there a way to only allow the user to type in numerics to a text field? I do not want to allow them to even type in anything unless it is a number. Basically, I don't want to allow them to enter hi and then I do checks and give them a warning that it isn't a number, I want to force it from the start. Thanks, Eddie -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] numerics
On Tuesday 11 February 2003 02:27, Edward Peloke wrote: IS there a way to only allow the user to type in numerics to a text field? I do not want to allow them to even type in anything unless it is a number. Basically, I don't want to allow them to enter hi and then I do checks and give them a warning that it isn't a number, I want to force it from the start. You can use javascript to enforce it at the input stage. But ultimately there's nothing that can stop people from submitting whatever they want. If you value the integrity of your data you NEED server-side verification -- there's no substitute for it. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* I'm sorry a pentium won't do, you need an SGI to connect with us. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] numerics
Check out: is_numeric() http://www.php.net/manual/en/function.is-numeric.php -Kevin - Original Message - From: Edward Peloke [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, February 10, 2003 11:27 AM Subject: [PHP] numerics IS there a way to only allow the user to type in numerics to a text field? I do not want to allow them to even type in anything unless it is a number. Basically, I don't want to allow them to enter hi and then I do checks and give them a warning that it isn't a number, I want to force it from the start. Thanks, Eddie -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] numerics
Edward Peloke [EMAIL PROTECTED] wrote: IS there a way to only allow the user to type in numerics to a text field? I do not want to allow them to even type in anything unless it is a number. Basically, I don't want to allow them to enter hi and then I do checks and give them a warning that it isn't a number, I want to force it from the start. PHP is server-side so it can't be accomplished via PHP, but it can via JavaScript. Google for something like 'javascript validate numeric'. Here's JS script that limits entry to alphanumeric characters. I've seen better JS code to do the same so if it's not suitable keep looking. http://javascript.internet.com/forms/val-char.html -- Steve Werby President, Befriend Internet Services LLC http://www.befriend.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] numerics
I'm sorry I misunderstood. As previously stated PHP is server-side only, you need a client-side solution. Search for Javascript validate numeric. - Kevin - Original Message - From: Kevin Stone [EMAIL PROTECTED] To: Edward Peloke [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Monday, February 10, 2003 11:38 AM Subject: Re: [PHP] numerics Check out: is_numeric() http://www.php.net/manual/en/function.is-numeric.php -Kevin - Original Message - From: Edward Peloke [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, February 10, 2003 11:27 AM Subject: [PHP] numerics IS there a way to only allow the user to type in numerics to a text field? I do not want to allow them to even type in anything unless it is a number. Basically, I don't want to allow them to enter hi and then I do checks and give them a warning that it isn't a number, I want to force it from the start. Thanks, Eddie -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] numerics
I guess it might be possible with javascript. At the very least, you can do a validation client-side for numbers only before submitting. Justin. on 11/02/03 5:27 AM, Edward Peloke ([EMAIL PROTECTED]) wrote: IS there a way to only allow the user to type in numerics to a text field? I do not want to allow them to even type in anything unless it is a number. Basically, I don't want to allow them to enter hi and then I do checks and give them a warning that it isn't a number, I want to force it from the start. Thanks, Eddie -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php