Re: HTML_QuickForm and line?
| From: | Justin Patrin | Date: | Thu, 14 Jul 2005 14:50:49 +0000 |
| Subject: | Re: HTML_QuickForm and line? | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-20001@lists.php.net to get a copy of this message | ||
On 7/14/05, Martin Klaffenboeck <martin.klaffenboeck@gmx.at> wrote:
> Hello!
>
> How can I produce a Form like:
>
> <table id="Login" cellpadding="0" cellspacing="2"
> border="0">
> <form action="<?=$link_root?>/user/login.php" method="post">
> <tr>
> <td align="right">Email: </td>
> <td><input type="text" name="Login[Email]" size="15"
> value="<?=
> $_POST['Login']['Email'] ?>"/></td>
> </tr>
> <tr>
> <td align="right">Passwort: </td>
> <td><input type="password" name="Login[Password]"
> size="15" /></td>
> </tr>
> <tr>
> <td align="center" colspan="2">
> <a href="<?=$link_root?>/user/register.php">
> <img src="<?=$link_root?>/images/layout/kein_account.gif"
> border="0"/></a>
>
> <input type="image" name="Login[Submit]" value="Login"
> src="<?=$link_root?>/images/layout/anmelden.gif"
> style="border:0px"/>
> </td>
> </tr>
> </form>
> </table>
>
> Especially the last line is a problem for me. I tried:
>
> $form = new HTML_QuickForm("Login", 'post',
> $link_root . "/user/login.php");
>
> $form->addElement ('text', 'Email', 'Email:',
> array("size" => 15));
> $form->addElement ('password', 'Password', 'Passwort:',
> array("size" => 15));
>
> // It's good until here.
>
> // The following is good, I can use a form element instead of the link:
> $buttons[] = &HTML_QuickForm::createElement('image', 'NoAccount',
> $link_root . '/images/layout/kein_account.gif');
>
> $buttons[] = &HTML_QuickForm::createElement('image', 'Submit',
> $link_root . '/images/layout/anmelden.gif');
>
> $form->addGroup($buttons, null, null, ' ');
>
> Because of the $form->validate() the different Element Names are ok.
> But how can I get the last row of the table? The Group seems to pack all
> onto the right column instead of colspaning the row.
>
Alter the element template in the renderer.
$renderer =& HTML_QuickForm::defaultRenderer();
$renderer->setElementTemplate(...);
--
Justin Patrin