php numeric textbox

i have a problem that i can break into two parts any help would be appreciated.

1:- i need to create a textbox that will only except numeric values (preferably validated in php)
2:- the value of the textbox must have a max value so no input can be higher than specified (preferably php)

try (!is_numeric($_GET[‘Name of your textbox’] die(‘go back and write numbers only in the field’);
Should be able to limit the value thru a if statement.

Hi, See the below example i think your looking for this [php] <? // save this code as checknumber.php and run if($REQUEST_METHOD == 'POST') { if(is_numeric(trim($_POST['onlynumber']))) { echo ''.trim($_POST['onlynumber']).' is Numeric'; } else { echo ''.trim($_POST['onlynumber']).' Not Numeric'; } } ?> Zip code : [/php] i hope this will helpful for you. Reply your Feedback.. ~~SR~~

i tryed the given code but didnt work ? thanks though

Hi given code to you is working fine for me. if you are still facing issue post your code here. i will help you. ~~SR~~


i keep getting this error from just the code given i havnt added or removed anything

Sponsor our Newsletter | Privacy Policy | Terms of Service