Hi,
I need non-submit buttons (for Javascript actions)
and this is the extension for the oohforms class:
It's basically nothing but a copy of of_submit, where
the "submit" string is changed to "button". But it
works for me and I think it's useable. If somebody
has a cleaner approach, well, then go ahead :-)
--------------------------------------------------
class of_button extends of_element {
var $src;
function of_button($a) {
$this->setup_element($a);
}
function self_get($val, $which, &$count) {
$str = "";
$sv = empty($val) ? $this->value : $val;
$str .= "<input name='$this->name' value='$sv'";
if ($this->src)
$str .= " type='image' src='$this->src'";
else
$str .= " type='button'";
if ($this->extrahtml)
$str .= " $this->extrahtml";
$str .= ">";
return $str;
}
function self_load_defaults($val) {
// BUTTON will not change its value
}
} // end BUTTON
---------------------------------------------------