Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.

smartyvalidate & how it display message

 
Post new topic   Reply to topic    Smarty Forum Index -> Add-ons
View previous topic :: View next topic  
Author Message
limbhg
Smarty Regular


Joined: 18 Jun 2004
Posts: 62

PostPosted: Tue Jul 06, 2004 11:12 am    Post subject: smartyvalidate & how it display message Reply with quote

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


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

PostPosted: Tue Jul 06, 2004 1:57 pm    Post subject: Re: smartyvalidate & how it display message Reply with quote

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


Joined: 18 Jun 2004
Posts: 62

PostPosted: Wed Jul 07, 2004 1:53 am    Post subject: Reply with quote

hi morht,

thanks man...
Back to top
View user's profile Send private message Yahoo Messenger
Display posts from previous:   
Post new topic   Reply to topic    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