var $onSubmit; // can be set with options
var $onReset; // can be set with options
- function PlekitForm ($full_url, $values, $options=NULL) {
+ function __construct ($full_url, $values, $options=NULL) {
// so we can use the various l_* functions:
// we parse the url to extract var-values pairs,
// and add them to the 'values' argument if any
$this->values=$values;
// make strict xhtml happy
- $this->method="post"; if ($options['method']) $this->method=strtolower($options['method']);
- $this->onSubmit=NULL; if ($options['onSubmit']) $this->onSubmit=$options['onSubmit'];
- $this->onReset=NULL; if ($options['onReset']) $this->onReset=$options['onReset'];
+ $this->method="post"; if (isset($options['method']) && (!empty($options['method']))) $this->method=strtolower($options['method']);
+ $this->onSubmit=NULL; if (isset($options['onSubmit']) && (!empty($options['onSubmit']))) $this->onSubmit=$options['onSubmit'];
+ $this->onReset=NULL; if (isset($options['onReset']) && (!empty($options['onReset']))) $this->onReset=$options['onReset'];
}
function start () { print $this->start_html(); }
var $button_id;
var $button_text;
- function PlekitFormButton ($full_url, $button_id, $button_text, $method="POST") {
+ function __construct ($full_url, $button_id, $button_text, $method="POST") {
$this->PlekitForm($full_url,array(),$method);
$this->button_id=$button_id;
$this->button_text=$button_text;