HTML quickform several forms
| From: | Oscar Karlsson | Date: | Mon, 25 Oct 2004 21:27:24 +0000 |
| Subject: | HTML quickform several forms | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-15100@lists.php.net to get a copy of this message | ||
Hi there!
I can use quickform as a stand alone web page but when I try to integrate it with another page it fails. This script is suppose to show a form when index.php?action=insert and then process it after done is clicked. no form or no result should be shown if the page is accessed the normal way.
Been looking through several tutorials but none of them cover this..
Thankful for any help
Oscar
[code]
$form = new HTML_QuickForm('input');
//take care of actions on this page
if (isset($_GET['action'])) {
//insert a post
if ($_GET['action'] == 'insert') { $form->addElement('header', null, 'add post');
$form->addElement('text', 'mupp', 'Title (en)', array('size' => 50, 'maxlength' => 255));
$form->addElement('submit', null, 'Send');
}
}
if ($form->validate())
print_r($form->exportValue('mupp'));
else
$form->display();