|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
tangfucius Smarty Rookie
Joined: 30 Sep 2004 Posts: 16
|
Posted: Thu Sep 30, 2004 8:40 pm Post subject: Problem validating fields with names like field[id][item] |
|
|
Here is my session SmartyValidate data:
Array ( [default] => Array ( [registered_funcs] => Array ( [criteria] => Array ( ) [transform] => Array ( ) ) [validators] => Array ( [0] => Array ( [field] => registrants[683802][email] [criteria] => isEmail [message] => Invalid Email address [trim] => [empty] => [halt] => [valid] => ) ) [is_error] => 1 ) )
Here is my _Post Data
Array ( [registrants] => Array ( [683802] => Array ( [prefix] => Mr. [firstname] => [lastname] => [email] => tangyi@hotmail.com [address1] => [address2] => [city] => [state] => [zipcode] => ) ) [submit] => Next Page )
Any solutions would be greatly appreciated. |
|
Back to top |
|
tangfucius Smarty Rookie
Joined: 30 Sep 2004 Posts: 16
|
Posted: Thu Sep 30, 2004 8:42 pm Post subject: |
|
|
Addtional info:
The problem is that i entered the correct email address format, but it didn't validate. When i changed the field name from registratnts[id][email] to
simply "email", it worked. So my question is, is there anyway to make it validate array elements with SmartyValidate?
Thanks. |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Thu Sep 30, 2004 8:50 pm Post subject: |
|
|
It doesn't handle nested arrays like that. (why organize it that way in the form?)
However, if a single form element is an array, the validator is applied to each array element. |
|
Back to top |
|
tangfucius Smarty Rookie
Joined: 30 Sep 2004 Posts: 16
|
Posted: Thu Sep 30, 2004 9:12 pm Post subject: |
|
|
ok. great. I took over a project from some other programmer and want to apply smartyvalidate to the forms, however the existing system takes in array form fields. If you can make modifications to it to make it validate nested arrays, it would be great. If not, understandable. |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|