QuickForm and Validation
| From: | Cédric Fournier | Date: | Wed, 01 Dec 2004 14:53:15 +0000 |
| Subject: | QuickForm and Validation | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-15947@lists.php.net to get a copy of this message | ||
Hello,
I've got two problems.
First, I need to validate a date. I'm using this to add my date to the form
:
$options = array(
'language' => 'fr',
'format' => 'dmY',
'minYear' => 2004,
'maxYear' => 2014);
$Date =& HTML_QuickForm::CreateElement('date','Date','Date
:',$options);
$form->addElement($Date);
But I can't find a Rule to say that '31/02/2004' is not valide and throw me
an error on the form.
And second, I want to disable the rule for one of my button submit. I'm
using this code :
$Btn[] =&
HTML_QuickForm::CreateElement('submit','Action','Modifier');
$Btn[] =&
HTML_QuickForm::CreateElement('submit','Action','Supprimer');
$form->addGroup($Btn,'Btn','',' ',false);
I want that my rules apply when I click on Modifier but not on Supprimer.
Please help me, I read the documentation and find no way to solve my problem
Thanks a lot for your answer.