Re: QuickForm set no values
| From: | Bertrand Mansion | Date: | Thu, 30 May 2002 16:57:40 +0000 |
| Subject: | Re: QuickForm set no values | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-1525@lists.php.net to get a copy of this message | ||
le 30/05/02 18:33, Georg Bez à georgbez@web.de a écrit :
> hi,
>
> i have follow code test on my local WAMP with PHP 4.2.1.
> on my linux server will this not run. QuickForm set no values in html.
> Can you help me?
> Thanks.
>
> Georg
>
> require_once ("HTML/QuickForm.php");
> $form = new HTML_QuickForm('image2content', 'POST',
> $_SERVER['PHP_SELF']);
>
> $defaultValues['image_border'] = 0;
> $defaultValues['image_vspace'] = 3;
> $defaultValues['image_hspace'] = 3;
>
> $form->setDefaults( $defaultValues );
>
> if ( $_GET[cid] ) $form->addElement('hidden', 'cid', $_GET[cid]);
> $form->addElement('file', 'image_file', 'Bilddatei:');
> if ( $image_src ) $form->addElement('image', 'image_src', $image_src);
> $form->addElement('text', 'image_alt', 'Beschreibung:');
> $form->addElement('text', 'image_border', 'Rahmen:');
> $form->addElement('text', 'image_vspace', 'Vertikaler
> Abstand:');
> $form->addElement('text', 'image_hspace', 'Horizontaler
> Abstand:');
> $form->addElement('select', 'image_align', 'Ausrichtung:',
> array('rechts'=>'right', 'links'=>'left'));
> $buttons[] = &HTML_QuickForm::createElement('submit', null,
> 'Speichern');
> #$buttons[] = &HTML_QuickForm::createElement('reset', null, 'Reset');
> $form->addElementGroup($buttons);
>
> #$form->addRule('image_alt', 'Bitte geben Sie eine Beschreibung zum Bild
> an.', 'required');
> // FILE RULES
> #$form->addRule('image_file', 'Cannot exceed 1776 bytes',
> 'maxfilesize',
> 1776);
> #$form->addRule('image_file', 'Must be XML', 'mimetype',
> 'text/xml');
> #$form->addRule('image_file', 'Must be *.xml', 'filename',
> '/^.*\.xml$/');
> $form->addRule('image_file', 'Required File Upload',
> 'uploadedfile');
>
> // Tries to validate the form
> if ( $form->validate() ) {
> # [ ... ]
> }
> # end
Your code works fine for me.
It sets the right values in the right places.
I don't see what's wrong. Make sure you use the last release.
Bertrand Mansion
Mamasam