From 861175c0d88d42f39ca90184bfef6f00831777a9 Mon Sep 17 00:00:00 2001 From: Hitesh Aggarwal Date: Wed, 2 Dec 2020 14:03:18 +0530 Subject: [PATCH] Minor Fixes for WCAG --- layouts/field.php | 13 ++++++------- layouts/fields/calendar.php | 1 + layouts/fields/checkbox.php | 2 +- layouts/fields/file.php | 1 + layouts/fields/text.php | 1 + layouts/fields/textarea.php | 1 + layouts/label.php | 4 +++- 7 files changed, 14 insertions(+), 9 deletions(-) diff --git a/layouts/field.php b/layouts/field.php index e2e2f45..91f3543 100644 --- a/layouts/field.php +++ b/layouts/field.php @@ -1,4 +1,5 @@ show_label === null ? 1 : $field->show_label; -if ($field->type == 'hidden' ) { +if ($field->type == 'hidden') { echo $input; } else { ?> -
-
- +
+
- - + +
-
\ No newline at end of file diff --git a/layouts/fields/calendar.php b/layouts/fields/calendar.php index e6772dc..fab4386 100644 --- a/layouts/fields/calendar.php +++ b/layouts/fields/calendar.php @@ -9,6 +9,7 @@ defined('_JEXEC') or die; extract($displayData); $attrs = []; +$attrs[] = 'id="' . $field->id . '"'; if (isset($field->placeholder) && !empty($field->placeholder)) { $attrs[] = 'placeholder="' . $field->placeholder . '"'; } diff --git a/layouts/fields/checkbox.php b/layouts/fields/checkbox.php index 519f850..e12b73d 100644 --- a/layouts/fields/checkbox.php +++ b/layouts/fields/checkbox.php @@ -10,7 +10,7 @@ extract($displayData); $options = ModJDSimpleContactFormHelper::getOptions($field->options); $attrs = []; - +$attrs[] = 'id="' . $field->id . '"'; if ($field->required) { $attrs[] = 'required'; if (isset($field->custom_error) && !empty(trim($field->custom_error))) { diff --git a/layouts/fields/file.php b/layouts/fields/file.php index 07b383d..145e2ee 100644 --- a/layouts/fields/file.php +++ b/layouts/fields/file.php @@ -9,6 +9,7 @@ defined('_JEXEC') or die; extract($displayData); $attrs = []; +$attrs[] = 'id="' . $field->id . '"'; if ($field->required) { $attrs[] = 'required'; if (isset($field->custom_error) && !empty(trim($field->custom_error))) { diff --git a/layouts/fields/text.php b/layouts/fields/text.php index 0a99374..9f4befd 100644 --- a/layouts/fields/text.php +++ b/layouts/fields/text.php @@ -9,6 +9,7 @@ defined('_JEXEC') or die; extract($displayData); $attrs = []; +$attrs[] = 'id="' . $field->id . '"'; switch ($field->type) { case 'email': $attrs[] = 'data-parsley-type="email"'; diff --git a/layouts/fields/textarea.php b/layouts/fields/textarea.php index 5196933..f0ea123 100644 --- a/layouts/fields/textarea.php +++ b/layouts/fields/textarea.php @@ -9,6 +9,7 @@ defined('_JEXEC') or die; extract($displayData); $attrs = []; +$attrs[] = 'id="' . $field->id . '"'; if ($field->required) { $attrs[] = 'required'; if (isset($field->custom_error) && !empty(trim($field->custom_error))) { diff --git a/layouts/label.php b/layouts/label.php index 9c2b580..4f12761 100644 --- a/layouts/label.php +++ b/layouts/label.php @@ -1,4 +1,5 @@ show_label === null ? 1 : $field->show_label; ?> -