Skip to content

Commit

Permalink
改进zbpform,加入了placeholder;
Browse files Browse the repository at this point in the history
  • Loading branch information
rainbowsoft committed Dec 10, 2024
1 parent d4da78b commit 5e86675
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions zb_system/function/lib/zbpform.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,10 @@ public static function checkbox($name, $array)
echo $s;
}

public static function text($name, $value, $width = '150px')
public static function text($name, $value, $width = '150px', $placeholder = '')
{
$style = $width ? ' style="width: ' . $width . ';"' : '';
$s = "<input type=\"text\" name=\"$name\" id=\"$name\" class=\"$name\" value=\"$value\"$style/>\r\n";
$s = "<input type=\"text\" name=\"$name\" id=\"$name\" class=\"$name\" value=\"$value\" placeholder=\"$placeholder\" $style/>\r\n";
if (self::$setreturn) {
return $s;
}
Expand All @@ -108,10 +108,10 @@ public static function hidden($name, $value)
echo $s;
}

public static function textarea($name, $value, $width = '250px', $height = '100px')
public static function textarea($name, $value, $width = '250px', $height = '100px', $placeholder = '')
{
$style = $width ? ' style="width: ' . $width . '; height: ' . $height . '"' : '';
$s = "<textarea name=\"$name\" id=\"$name\" class=\"$name\"$style>$value</textarea>\r\n";
$s = "<textarea name=\"$name\" id=\"$name\" class=\"$name\" placeholder=\"$placeholder\" $style>$value</textarea>\r\n";
if (self::$setreturn) {
return $s;
}
Expand Down

0 comments on commit 5e86675

Please sign in to comment.