| Luca Giandoso 2007-01-15, 8:01 am |
| I think it is correct.
(you can use only $form->display(); to view the form or toHtml() to
get the string of the form)
On 1/15/07, Marco Sottana <marco.sottana@q-web.it> wrote:
> like this ? do you suggest any optimize ?
>
> code:
> <SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
> <!--
> function enableSubmit(checkobj){
> var f=document.getElementById("idsubmit");
> f.disabled=!checkobj.checked;
> }
> //-->
> </SCRIPT>
>
>
> <?php
> // Load the main class
> require_once 'HTML/QuickForm.php';
> $form = new HTML_QuickForm('firstForm');
> $el = &HTML_QuickForm::createElement("textarea", "a","b",null);
> $form->addElement($el);
> $form->addElement('checkbox', 'nomecheckbox', 'Accept terms',
> "Yes",array("onClick" => "enableSubmit(this); " ));
>
> $form->addElement('submit', null,
> 'Send',array("id"=>"idsubmit","disabled"));
> if ($form->validate()) {
> $form->freeze();
> }
>
> echo $form->display();
>
>
>
> ----- Original Message -----
> From: "Luca Giandoso" <luca.giandoso@gmail.com>
> To: "Marco Sottana" <marco.sottana@q-web.it>
> Cc: <pear-general@lists.php.net>
> Sent: Monday, January 15, 2007 9:30 AM
> Subject: Re: [PEAR] [QUICKFORM] checkbox required for enable submit button
>
>
>
>
|