For Programmers: Free Programming Magazines  


Home > Archive > PHP Pear > January 2007 > Re: [PEAR] [QUICKFORM] checkbox required for enable submit button









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: [PEAR] [QUICKFORM] checkbox required for enable submit button
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
>
>
>
>

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com