Developer Support »

Checking length of field input  (See more user questions)

Hi .

Good to hear from you.

You could use the str_len() function, like so:

if(strlen($_REQUEST['field_name']) != 1){$errors[] = "Please go BACK and try again";}

Just change 'field_name' for the actual field name.

Put it after this line in the script:

$errors = array();

"str_len" stands for "string length" and that's simply what it does...checks the length of the inputed string.

Best wishes.

Charles Sweeney
https://formtoemail.com
The world's easiest feedback script!

On 22/04/2011 21:37, wrote:
>
> Comments: Charles, in one of the fields in my form I ask for a single digit to be entered. Is there a way to require a single alphanumeric character, and if any more than one character is entered, they get a "Please go BACK and try again" message? This would be great! - Thanks.