diff options
Diffstat (limited to 'h-source/Library/Html')
-rw-r--r-- | h-source/Library/Html/Form.php | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/h-source/Library/Html/Form.php b/h-source/Library/Html/Form.php index ec81cfb..64c501f 100644 --- a/h-source/Library/Html/Form.php +++ b/h-source/Library/Html/Form.php @@ -208,4 +208,29 @@ class Html_Form { return $returnString; } + //return the HTML of an <input type='submit' ...> + //$name: the name of the input + //$value: the value of the input + //$className: the class name of the input + //$idName: name of the id + //$image: url of the image (if it is an image button) + //$attributes: list of attributes + static public function submit($name, $value, $className = null, $idName = null, $image = null, $attributes = null) + { + $strClass = isset($className) ? "class='".$className."'" : null; + $idStr = isset($idName) ? "id='".$idName."'" : null; + + if (isset($image)) + { + $returnString = "<input $attributes $idStr $strClass type='image' src='".$image."' value='$value'>\n"; + $returnString .= "<input type='hidden' name='".$name."' value='$value'>\n"; + } + else + { + $returnString ="<input $attributes $idStr $strClass type='submit' name='" .$name. "' value = '$value' />\n"; + } + + return $returnString; + } + }
\ No newline at end of file |