DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

PEAR:HTML_QuickForm

10.21.2005
| 4423 views |
  • submit to reddit
        HTML_QuickForm($form_name,$http_method,$rel_path,$target,$HTML_attributes)


// use the default method (POST), but change the action URL
$default_form = new HTML_QuickForm('default_form','','/dir/page.php');

// use the default $rel_path as $_SERVER['PHP_SELF']
$get_form = new HTML_QuickForm('get_form','GET');

// set form HTML attributes
$css_form = new HTML_QuickForm('css_form','','','','class="cform" id="css_form"');

// add button with HTML attribute
$css_form->addElement('button', 'close', 'Close','onClick="test();"');