RE: [PEAR] QF group required rule on Date element
| From: | Mike Carter | Date: | Tue, 06 Jan 2004 15:48:06 +0000 |
| Subject: | RE: [PEAR] QF group required rule on Date element | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-9998@lists.php.net to get a copy of this message | ||
Hello once more,
> -----Original Message-----
> From: Alexey Borzov [mailto:borz_off@cs.msu.su]
> Sent: 06 January 2004 12:01
>
> If the group was done mostly for presentation purposes, you may *try*
> adding it with $appendName = false. Maybe validation will
> work then...
> Then again, maybe not.
I've made the group parameter change and all is well. My setDefaults now
just references the element 'eventDate' without needing to mention the
parent group-name.
I do not know how you store all the elements and their heirachy
internally... Although the setDefaults() call works, the addGroupRule() call
fails with the error "QuickForm Error: nonexistent html element".
The group is defined as (I've cut out some non-essential string content):-
$eventDate[] = &HTML_QuickForm::createElement('date', 'eventDate', null,
array('format' => 'dMY', 'language' =>
$_SESSION['_lang'], 'minYear' =>
date('Y'), 'maxYear' => '1902', 'addEmptyOption' =>
true));
$eventDate[] = &HTML_QuickForm::createElement('link', 'help', '',
'?', ".",
array('onclick' => "", 'class' => 'helpLink'));
$this->addGroup($eventDate, 'eventDateGroup',$language['L_EventDate'], null,
false);
I defined my 'required' rule as follows:-
$this->addGroupRule('eventDate', $language['L_RequireDate'],
'required',
null, 3, 'client');
Alexey, you were dubious about wether it would work to begin with; is this
the problem you had in mind?
Regards,
Mike C.
________________________________________________________________________
This email has been scanned for all viruses by the MessageLabs Email
Security System. For more information on a proactive email security
service working around the clock, around the globe, visit
http://www.messagelabs.com
________________________________________________________________________