From: Sam White Date: Sat, 20 Nov 2021 16:42:59 +0000 (+0000) Subject: Add separate function to print field attributes. X-Git-Url: https://git.dalvak.com/public/?a=commitdiff_plain;h=16cee87e522241cc356fc8b9a5f84fdd2c967a3e;p=ycra.git Add separate function to print field attributes. --- diff --git a/public_html/includes/fields.php b/public_html/includes/fields.php index 94e4059..685825e 100644 --- a/public_html/includes/fields.php +++ b/public_html/includes/fields.php @@ -11,13 +11,17 @@ function get_field_id($name) { return $name; } +function print_attrs($attrs) { + foreach($attrs as $name=>$value) esc("$name='$value' "); +} + function general_bare_field($type, $values, $name, $attrs=[]) { $value = get_sent_field_value($values, $name); $id = get_field_id($name);?> $value) esc("$name=\"$value\" ");?> + print_attrs($attrs);?> />