From: Sam White Date: Sat, 20 Nov 2021 16:43:33 +0000 (+0000) Subject: Add functions to print textarea and checkbox fields. X-Git-Url: https://git.dalvak.com/public/?a=commitdiff_plain;h=596a7ba0700e62d982beb72f1382b5bf35040f94;p=ycra.git Add functions to print textarea and checkbox fields. --- diff --git a/public_html/includes/fields.php b/public_html/includes/fields.php index 685825e..ab04fc8 100644 --- a/public_html/includes/fields.php +++ b/public_html/includes/fields.php @@ -50,6 +50,38 @@ function password_field($values, $name, $label, $attrs=[]) { general_field('password', $values, $name, $label, $attrs); } +function textarea($values, $name, $label, $attrs=[]) { + if (!array_key_exists('rows', $attrs)) $attrs['rows'] = '6'; + if (!array_key_exists('cols', $attrs)) $attrs['cols'] = '50'; + + $value = get_sent_field_value($values, $name); + $id = get_field_id($name);?> + +
+ + +
+ +
+ /> +
$value], $name); }