Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

SmartyValidate does not accept template variables

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Add-ons
View previous topic :: View next topic  
Author Message
avneeshjain
Smarty n00b


Joined: 17 Sep 2008
Posts: 2

PostPosted: Wed Sep 17, 2008 11:16 am    Post subject: SmartyValidate does not accept template variables Reply with quote

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
View user's profile Send private message
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7368
Location: Lincoln Nebraska, USA

PostPosted: Wed Sep 17, 2008 1:44 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
avneeshjain
Smarty n00b


Joined: 17 Sep 2008
Posts: 2

PostPosted: Wed Sep 17, 2008 3:02 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Add-ons All times are GMT
Page 1 of 1

 
Jump to:  
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
Protected by Anti-Spam ACP