I have a repeating function to add. The user enters the number of how many
numbers they want to add, then it repeats a form field. What I want to do is
detect to make sure that the value they enter is a number. If not, don't do
the do while loop and if it is, then go ahead and do it. How can I do this?
If you don't want to deal with any JavaScript, I suggest you try a simple ereg function like below:

//$num = number entered by user

if(ereg("[^0-9]+",$num):
//returns true, a non numeric character was found
else:
//returns false, the string is all numbers
endif;

I haven't tested the above, so it may not work syntactically but the concept is the same...

--
Kyle Gibson
admin(at)frozenonline.com
http://www.frozenonline.com/


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to