|
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 |
Net Genius Smarty Rookie
Joined: 25 Aug 2008 Posts: 7
|
Posted: Mon Aug 25, 2008 4:05 pm Post subject: [SV] isURL query |
|
|
Hi. I'm just starting to use smartyValidate, and I like what I see, but I have a quick question.
I'm looking to use the isURL validator, however I only want it to run if the field isn't empty.
I.e. if the field is left blank, then the script continues as normal, however if someone does enter something, then that something needs to be a valid URL.
Can you point me in the right direction please?
Thank you. |
|
Back to top |
|
Celeb Administrator
Joined: 17 Apr 2007 Posts: 1025 Location: Vienna
|
Posted: Mon Aug 25, 2008 4:11 pm Post subject: |
|
|
This should do the trick:
Code: | SmartyValidate::register_validator('foo', 'url', 'isURL', true); |
_________________ Darn computers always do what I tell them to instead of what I want them to do. |
|
Back to top |
|
Net Genius Smarty Rookie
Joined: 25 Aug 2008 Posts: 7
|
Posted: Mon Aug 25, 2008 4:14 pm Post subject: |
|
|
That works a treat. Thank you |
|
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
|