Re: Re: DO Formbuilder: crosslinks (checkboxes) Problem solved !! ?
| From: | Justin Patrin | Date: | Tue, 07 Dec 2004 17:28:38 +0000 |
| Subject: | Re: Re: DO Formbuilder: crosslinks (checkboxes) Problem solved !! ? | ||
| References: | 1 2 3 4 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-16086@lists.php.net to get a copy of this message | ||
On Tue, 7 Dec 2004 14:10:15 +0100, Alexander Petri <alex.petri@gmx.de> wrote:
> for experimenting with checkboxes -> try out this:
>
> <?php
> require_once("HTML/QuickForm.php");
>
> $f=new HTML_QuickForm('name', 'post', '', '_self',
> null, true);
> $f->addElement("text","p1","Textbox1: ");
>
> for($i=0;$i<10;$i++)
>
> $el[]=HTML_QuickForm::createElement("checkbox","ch_".$i,"Check".$i,'Checkbox
> '.$i);
>
> $f->addGroup($el,'groupOne',"Checkboxgroup","<br>\n");
>
> $f->addElement("submit","submit","Submit");
> $f->addRule("p1","ERROR","minlength",6);
>
> $f->setDefaults(array( "p1" => "bla",
> "groupOne" => array( "ch_3"=>"checked",
> "ch_7"=>2)
>
> ));
> if($f->validate()) $f->freeze();
> $f->display();
>
> ?>
> <br>
> <a href="<? echo $PHP_SELF ?>">RESTART</a>
>
::sigh:: I *swear* that didn't work yesterday. Anyway, seems to work,
nice job. Unfortunately, we may still have a problem with
triplelinks...but I'll get to that later.
--
Justin Patrin