Quickform not creating valid forms.
| From: | Sandip Bhattacharya | Date: | Wed, 22 Oct 2003 09:10:50 +0000 |
| Subject: | Quickform not creating valid forms. | ||
| Groups: | php.pear.dev | ||
| Request: | Send a blank email to pear-dev+get-22893@lists.php.net to get a copy of this message | ||
I am repeatedly getting invalid form using quickform since the very beginning. The forms are coming out in the form
<formArray>
[...]
</form>
I looked into the source, and found the problem in the finishForm() of the default renderer.
1 function finishForm(&$form)
2 {
3 // add a required note, if one is needed
4 if (!empty($form->_required) && !$form->_freezeAll) {
5 $this->_html .= str_replace('{requiredNote}', $form->getRequiredNote(), $this->_requiredNoteTemplate);
6 }
7 // add form attributes and content
8 $html = str_replace('{attributes}', $form->getAttributes(true), $this->_formTemplate);
9 $this->_html = str_replace('{content}', $this->_html, $html);
10 // add a validation script
11 if ('' != ($script = $form->getValidationScript())) {
12 $this->_html = $script . "\n" . $this->_html;
13 }
14 } // end func finishForm
Notice that in line 8, str_replace is called with the replace value to be an associative array.
This replacement doesnt work in any of the PHP versions that I work with (4.2.2 and 4.3.3). Am I doing anything wrong? I just tried the examples that came along with quickform-3.1.1 that downloaded just a while back. None of the samples worked.
- Sandip
--
Sandip Bhattacharya http://www.sandipb.net
sandip at puroga.com
Puroga Technologies Pvt. Ltd.
http://www.puroga.com