Menu

#10 Class of_button for oohforms

open
nobody
5
2001-10-03
2001-10-03
No

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
---------------------------------------------------

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.