|
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 |
avneeshjain Smarty n00b
Joined: 17 Sep 2008 Posts: 2
|
Posted: Wed Sep 17, 2008 11:16 am Post subject: SmartyValidate does not accept template variables |
|
|
Hi,
I am using the latest version of SmartyValidate-2.9. I used the following line in my template
{validate id="cname" message=$err_msg_required}
validate function doesnt return anything. If I hard code the message to a string then that string is printed correctly. If I print {$err_msg_required} the variable is printed correctly. Does SmartyValidate accept template variables as attribute values?
Thanks
Avneesh |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Wed Sep 17, 2008 1:44 pm Post subject: |
|
|
It should , but make sure you reset SmartyValidate if your message changes. It stores the value in the session the first time the page is displayed. |
|
Back to top |
|
avneeshjain Smarty n00b
Joined: 17 Sep 2008 Posts: 2
|
Posted: Wed Sep 17, 2008 3:02 pm Post subject: |
|
|
Hi Monte,
That explains it - when the page renders for the the first time the template variable is not set. But my usecase is such that the message is constructed dynamically at the time of form submission. Any workaround that SmartyValidate does not use the message value from the session.
Thanks
Avneesh |
|
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
|