|
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 |
cmi Smarty n00b
Joined: 14 Jan 2004 Posts: 1
|
Posted: Wed Jan 14, 2004 4:25 pm Post subject: question about formgenerator and -validator-plugin |
|
|
Hi,
I hope somebody can help me with my problem. I tried the formgenerator/-validator-plugin the first time today and this class is amazing.
But I have one problem. How can I determine a field to be optional, but IF something is entered it must have the correct syntax. E.g. if somebody enters his phone number, it has to be a number. But if he doesn't enter anything there, it must be okay too.
If I enter it in this way
Code: |
$form->AddInput(array(
"TYPE"=>"text",
"NAME"=>"phone",
"ID"=>"phone",
"ReplacePatterns"=>array( // replace
"[^0-9]"=>""
),
"ValidateAsInteger"=>1,
"ValidationErrorMessage"=>"It was not specified a valid phone number",
"MAXLENGTH"=>15,
"SIZE"=>20,
"ONCHANGE"=>"if(value.toLowerCase) value=value.toLowerCase()"
));
|
the script is requesting an input here
Can somebody help me with this? 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
|