|
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 |
einlemming Smarty Rookie
Joined: 04 May 2004 Posts: 10 Location: Stuttgart, Germany
|
Posted: Wed Jul 07, 2004 1:19 pm Post subject: Validate form field only if its not empty |
|
|
Hi guys,
I need some help with the SmartyValidator.
I am trying to validate a field only if it is not empty.
The Validation should be set to true if there is no content in the field, but if there is something typed in, I want to check for a number.
Example :
Leave the field empty : Form continues
Field has value "123" by the user : Form checks for isnumber.
Thanks in advance for your help! _________________ See ya, Lemming |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Wed Jul 07, 2004 1:25 pm Post subject: |
|
|
{validate field="myfield" criteria="isNumber" empty=true message="..."}
That will allow a decimal value too, use isInt for whole numbers only. |
|
Back to top |
|
einlemming Smarty Rookie
Joined: 04 May 2004 Posts: 10 Location: Stuttgart, Germany
|
Posted: Wed Jul 14, 2004 1:15 pm Post subject: |
|
|
Thanks a lot for your help mohrt. This one worked for me _________________ See ya, Lemming |
|
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
|