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

How to validate form conditionally by SmartyValidate?

 
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
butely
Smarty n00b


Joined: 18 Aug 2006
Posts: 2

PostPosted: Fri Aug 18, 2006 11:47 am    Post subject: How to validate form conditionally by SmartyValidate? Reply with quote

Hello,

SmartyValidate is a great add-ons,I have applied it in my project .Here is my question:

If an input-box should be empty OR a URL,what should I do?

I have tried to add "empty=yes" in the template such as {validate ... empty="yes"},but it doesn't work.

Can anyone help me? Thanks a lot.
Back to top
View user's profile Send private message
mohrt
Administrator


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

PostPosted: Fri Aug 18, 2006 1:27 pm    Post subject: Reply with quote

When you register the validator, specify true for the empty parameter.
Back to top
View user's profile Send private message Visit poster's website
kills
Smarty Elite


Joined: 28 May 2004
Posts: 493

PostPosted: Fri Aug 18, 2006 4:45 pm    Post subject: Reply with quote

the value of the empty param should be booleanized.
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