|
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 |
limbhg Smarty Regular
Joined: 18 Jun 2004 Posts: 62
|
Posted: Tue Jul 06, 2004 11:12 am Post subject: smartyvalidate & how it display message |
|
|
Hi guys,
I am new to smarty, after reading all these articles, i am still stuck n not sure how it works. I also noticed there are not many people using smartyvalidate class? not many posts under addson.
{validate form="form1" field="address" criteria="notEmpty" message="address cannot be empty"}
above e.g. show to validate form1 and address field which criteria is notEmpty. the message is 'address cannot be empty'
if i dun enter any value to the address field, and i hit "submit" . what will i get?
unlike javascript, i can set alert('address cannot be empty'); but smartyvalidate, how it works? i know it is checked at serverside, but how does the server display the error message at the client side?
thanks. |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Tue Jul 06, 2004 1:57 pm Post subject: Re: smartyvalidate & how it display message |
|
|
limbhg wrote: | I am new to smarty, after reading all these articles, i am still stuck n not sure how it works. I also noticed there are not many people using smartyvalidate class? not many posts under addson. |
Probably because SmartyValidate is pretty new, only a month or two old.
limbhg wrote: |
{validate form="form1" field="address" criteria="notEmpty" message="address cannot be empty"}
above e.g. show to validate form1 and address field which criteria is notEmpty. the message is 'address cannot be empty'
if i dun enter any value to the address field, and i hit "submit" . what will i get?
unlike javascript, i can set alert('address cannot be empty'); but smartyvalidate, how it works? i know it is checked at serverside, but how does the server display the error message at the client side?
thanks. |
The error message is displayed by the tag itself when you redraw the form (after is_valid() fails.) Alternatively, you can assign your error messages to a template variable and then use that instead.
Try the examples that come with SmartyValidate, maybe it will become clearer. |
|
Back to top |
|
limbhg Smarty Regular
Joined: 18 Jun 2004 Posts: 62
|
Posted: Wed Jul 07, 2004 1:53 am Post subject: |
|
|
hi morht,
thanks man... |
|
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
|