|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
Adding rules
Hi again
Does any one know how to add a rule to the date element that insures that is does not validate if the date is not complete. This only insure that the date must be selected. $form->addGroupRule('start_date', 'enter a date', 'required'); I want to be prepared incase some one just add a day and not a month or year for example. |
|
#2
|
|||
|
|||
|
Using addGroupRule() isn't right, although it might be obvious because of the grouped elements that are generated by the 'date' element.
http://pear.php.net/manual/en/package.html.html-quickform.intro-validation.php, first paragraph in the "Group validation" section: "Groups of elements can be validated the same way other elements are, or use a more complex validation scheme. To validate a group as a whole, just use HTML_QuickForm::addRule(). The group elements' values will be passed to the validation function as an array." => addRule() should be used in your case |
![]() |
| Viewing: Codewalkers Forums > PHP Related > PEAR Packages > Adding rules |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|
|