Skip to content

Commit 861175c

Browse files
Minor Fixes for WCAG
1 parent 2f24787 commit 861175c

File tree

7 files changed

+14
-9
lines changed

7 files changed

+14
-9
lines changed

layouts/field.php

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
/**
34
* @package JD Simple Contact Form
45
* @author JoomDev https://www.joomdev.com
@@ -9,16 +10,14 @@
910
defined('_JEXEC') or die;
1011
extract($displayData);
1112
$show_label = $field->show_label === null ? 1 : $field->show_label;
12-
if ($field->type == 'hidden' ) {
13+
if ($field->type == 'hidden') {
1314
echo $input;
1415
} else {
1516
?>
16-
<div class="jdscf-col-md-<?php echo $field->width; ?>">
17-
<div class="form-group">
18-
<?php if ($show_label) { ?>
17+
<div class="jdscf-col-md-<?php echo $field->width; ?>">
18+
<div class="form-group">
1919
<?php echo $label; ?>
20-
<?php } ?>
21-
<?php echo $input; ?>
20+
<?php echo $input; ?>
21+
</div>
2222
</div>
23-
</div>
2423
<?php } ?>

layouts/fields/calendar.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
defined('_JEXEC') or die;
1010
extract($displayData);
1111
$attrs = [];
12+
$attrs[] = 'id="' . $field->id . '"';
1213
if (isset($field->placeholder) && !empty($field->placeholder)) {
1314
$attrs[] = 'placeholder="' . $field->placeholder . '"';
1415
}

layouts/fields/checkbox.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
extract($displayData);
1111
$options = ModJDSimpleContactFormHelper::getOptions($field->options);
1212
$attrs = [];
13-
13+
$attrs[] = 'id="' . $field->id . '"';
1414
if ($field->required) {
1515
$attrs[] = 'required';
1616
if (isset($field->custom_error) && !empty(trim($field->custom_error))) {

layouts/fields/file.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
defined('_JEXEC') or die;
1010
extract($displayData);
1111
$attrs = [];
12+
$attrs[] = 'id="' . $field->id . '"';
1213
if ($field->required) {
1314
$attrs[] = 'required';
1415
if (isset($field->custom_error) && !empty(trim($field->custom_error))) {

layouts/fields/text.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
defined('_JEXEC') or die;
1010
extract($displayData);
1111
$attrs = [];
12+
$attrs[] = 'id="' . $field->id . '"';
1213
switch ($field->type) {
1314
case 'email':
1415
$attrs[] = 'data-parsley-type="email"';

layouts/fields/textarea.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
defined('_JEXEC') or die;
1010
extract($displayData);
1111
$attrs = [];
12+
$attrs[] = 'id="' . $field->id . '"';
1213
if ($field->required) {
1314
$attrs[] = 'required';
1415
if (isset($field->custom_error) && !empty(trim($field->custom_error))) {

layouts/label.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
/**
34
* @package JD Simple Contact Form
45
* @author JoomDev https://www.joomdev.com
@@ -9,8 +10,9 @@
910
defined('_JEXEC') or die;
1011
extract($displayData);
1112
$label = ModJDSimpleContactFormHelper::getLabelText($field);
13+
$show_label = $field->show_label === null ? 1 : $field->show_label;
1214
?>
13-
<label class="d-block">
15+
<label for="<?php echo $field->id; ?>" class="<?php echo $show_label ? 'd-block' : 'd-none'; ?>">
1416
<?php echo $label; ?>
1517
<?php if ($field->required) { ?>
1618
<small class="text-danger">*</small>

0 commit comments

Comments
 (0)