Skip to content

Commit

Permalink
Minor Fixes for WCAG
Browse files Browse the repository at this point in the history
  • Loading branch information
hiteshaggarwal committed Dec 2, 2020
1 parent 2f24787 commit 861175c
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 9 deletions.
13 changes: 6 additions & 7 deletions layouts/field.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* @package JD Simple Contact Form
* @author JoomDev https://www.joomdev.com
Expand All @@ -9,16 +10,14 @@
defined('_JEXEC') or die;
extract($displayData);
$show_label = $field->show_label === null ? 1 : $field->show_label;
if ($field->type == 'hidden' ) {
if ($field->type == 'hidden') {
echo $input;
} else {
?>
<div class="jdscf-col-md-<?php echo $field->width; ?>">
<div class="form-group">
<?php if ($show_label) { ?>
<div class="jdscf-col-md-<?php echo $field->width; ?>">
<div class="form-group">
<?php echo $label; ?>
<?php } ?>
<?php echo $input; ?>
<?php echo $input; ?>
</div>
</div>
</div>
<?php } ?>
1 change: 1 addition & 0 deletions layouts/fields/calendar.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 . '"';
}
Expand Down
2 changes: 1 addition & 1 deletion layouts/fields/checkbox.php
Original file line number Diff line number Diff line change
Expand Up @@ -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))) {
Expand Down
1 change: 1 addition & 0 deletions layouts/fields/file.php
Original file line number Diff line number Diff line change
Expand Up @@ -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))) {
Expand Down
1 change: 1 addition & 0 deletions layouts/fields/text.php
Original file line number Diff line number Diff line change
Expand Up @@ -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"';
Expand Down
1 change: 1 addition & 0 deletions layouts/fields/textarea.php
Original file line number Diff line number Diff line change
Expand Up @@ -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))) {
Expand Down
4 changes: 3 additions & 1 deletion layouts/label.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* @package JD Simple Contact Form
* @author JoomDev https://www.joomdev.com
Expand All @@ -9,8 +10,9 @@
defined('_JEXEC') or die;
extract($displayData);
$label = ModJDSimpleContactFormHelper::getLabelText($field);
$show_label = $field->show_label === null ? 1 : $field->show_label;
?>
<label class="d-block">
<label for="<?php echo $field->id; ?>" class="<?php echo $show_label ? 'd-block' : 'd-none'; ?>">
<?php echo $label; ?>
<?php if ($field->required) { ?>
<small class="text-danger">*</small>
Expand Down

0 comments on commit 861175c

Please sign in to comment.