|
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 |
joannem Smarty Rookie
Joined: 11 Oct 2012 Posts: 6
|
Posted: Wed Oct 17, 2012 4:57 pm Post subject: SmartyValidate - Message |
|
|
I have set up my php programs to use SmartyValidate which works perfect.
My only question at this point is..... I also you a PEAR translation pkg so I would like to be able to have the Message in the SmartyValidate use a variable which contains the translated value.
for example if the following field {$tr_UserNmLbl} contains my translated message, how do I get that to work with
{validate id="vuname" message="** Users Name must contain a value **" }
I've tried
{validate id="vuname" message="{$tr_UserNmLbl}" } but that doesn't work for me.... any suggestions?
Thanks in advance! |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Wed Oct 17, 2012 5:55 pm Post subject: |
|
|
try:
{validate id="vuname" message=$tr_UserNmLbl} |
|
Back to top |
|
joannem Smarty Rookie
Joined: 11 Oct 2012 Posts: 6
|
Posted: Wed Oct 17, 2012 7:11 pm Post subject: |
|
|
Thanks for the suggestion, I tried both
{validate id="vuname" message=$tr_UserNmLbl}
and
{validate id="vuname" message="$tr_UserNmLbl"}
Neither gives me an error but I get no message either. |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Wed Oct 17, 2012 7:13 pm Post subject: |
|
|
does {$tr_UserNmLbl} have a value? |
|
Back to top |
|
joannem Smarty Rookie
Joined: 11 Oct 2012 Posts: 6
|
Posted: Wed Oct 17, 2012 7:16 pm Post subject: |
|
|
No actually it does not have a value..... was suposed to type $tr_UserNmLbl not $tr_UserNmVal.
It works perfectly as you suggested.
Thank you so much for your help!! |
|
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
|