|
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 |
Isidor128 Smarty Regular
Joined: 27 Jul 2004 Posts: 35 Location: France
|
Posted: Wed Jul 28, 2004 12:44 pm Post subject: Validate append="var" suggestion |
|
|
Hi
Using the append option is useful for grouping error messages
Code: | {validate field="FullName" criteria="notEmpty" append="errmsg" message=" Name A cannot be empty"}
...
{validate field="Size" criteria="isNumber" append="errmsg" message="Must be a Number"}
|
and we get in the array $errmsg
Code: |
{$errmsg} Array (2)
0 => Name A cannot be empty
1 => Must be Number
|
It would be perfect to get not only numeric indexes (0,1,...) but also the named index from the validate fileldname. Having
Code: |
{$errmsg} Array (2)
0 => Name A cannot be empty
FullName => Name A cannot be empty
1 => Must be Number
Size => Must be Number
|
Will be superb for error reporting
Regards |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Wed Jul 28, 2004 2:27 pm Post subject: |
|
|
It should probably be one or the other, and an associative array vs. an indexed array looks more useful, I'll get that changed in CVS. Thanks! |
|
Back to top |
|
Isidor128 Smarty Regular
Joined: 27 Jul 2004 Posts: 35 Location: France
|
Posted: Wed Jul 28, 2004 2:48 pm Post subject: |
|
|
Great !!! Thx !
By the way I've some trouble with the syntax for multi row (1 form per row)
as described here
http://www.phpinsider.com/smarty-forum/viewtopic.php?t=3100
if it's possible for you to have a look
I'm also experiencing issues with sessions, so even if there is no error,
SmartyValidate::is_valid($_POST) returns an error
The workarround wil be using the append option then verify if the array where append is done is empty or not.
This point is closed with the latest CVS version
regards |
|
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
|