The following warnings occurred: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.31 (Linux)
|
![]() |
email validation not working (api.php) - Printable Version +- Form Tools (https://forums.formtools.org) +-- Forum: Form Tools (https://forums.formtools.org/forumdisplay.php?fid=1) +--- Forum: General Discussion (https://forums.formtools.org/forumdisplay.php?fid=5) +--- Thread: email validation not working (api.php) (/showthread.php?tid=1283) |
email validation not working (api.php) - crunchers - May 10th, 2011 A bit of an odd one... Server-side email validation isn't working for some strange reason. I've tried changing the field name in case it conflicts with an already existing variable but no joy. The field is correctly repopulated in the event of a validation error elsewhere; it's merely refusing to validate (i.e. it's not being registered as a rule). Everything else works a treat otherwise: Code: <?php require_once($_SERVER['DOCUMENT_ROOT'].'/path/to/formtools/global/api/api.php'); Update: Seems to be a problem with "valid_email" param; it works when i use this: PHP Code: $rules[] = "required,email,Please enter a valid email address."; but not this: PHP Code: $rules[] = "valid_email,email,Please enter a valid email address."; ? Update 2: What a moron (me)! Just checked your validation script: PHP Code: // doesn't fail if field is empty I need to include BOTH rules to the field concurrently: valid_email AND required. Makes perfect sense. RE: email validation not working (api.php) - Ben - May 16th, 2011 Excellent! Glad you got it working. ![]() - Ben |