Re: Re: [QuickForm] Rules for a costum Form?
| From: | Bertrand Mansion | Date: | Fri, 07 Jun 2002 08:56:26 +0000 |
| Subject: | Re: Re: [QuickForm] Rules for a costum Form? | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-1602@lists.php.net to get a copy of this message | ||
le 6/06/02 18:20, Frank Thiel à thier6@gmx.de a écrit :
> Hi, Bertrand.
> Today i had time to make a new try.
>
>> just pass an array like this instead:
>>
>> $attributes = array('size' => 22, 'style' => 'WIDTH:183
>> px');
>> $form->addElement('text', 'ArticleHeadline',
>> 'ArticleHeadline:',$attributes);
>
> That´s a very good idea.
>
>> You'd better try to isolate your problem by writing smaller tests.
>
> No i do have the same Problem like before.
> Without $form->clearAllTemplates();, it works!
>
> Yes, that´s right. No here is a smaller codetest:
>
> <?php
> require_once("HTML/QuickForm.php");
> $form = new HTML_QuickForm('frmTest', 'POST', $PHP_SELF);
> $form->clearAllTemplates();
> $form->addElement('text', 'BannerIMG', 'BannerIMG:',
> '');
> $form->addElement('submit', null, 'Submit');
> $form->addRule('BannerIMG', 'Dies ist ein Pflichtfeld',
> 'required');
> if ($form->validate()) {
> $form->freeze();
> }
> $form->display();
> ?>
Check your HTML_Common version to be the last release.
use pear install HTML_Common if you are not sure.
Bertrand Mansion
Mamasam