Skip to content
Snippets Groups Projects
Commit f14ad2f1 authored by wodby's avatar wodby Committed by Kevin Paxman
Browse files

ISTWCMS-4729: adding input and select labels and submit value in search in...

ISTWCMS-4729: adding input and select labels and submit value in search in order to pass wave accrssibility
parent 4a89f916
No related branches found
No related tags found
1 merge request!239ISTWCMS 4729 ebremner search form
......@@ -33,7 +33,7 @@ class UwSearchForm extends FormBase {
// Element used to open the tray for phone view.
$form['opentray'] = [
'#type' => 'checkbox',
'#title' => $this->t('<span class="uw-search--checkboxlabel--labeltext"></span>'),
'#title' => $this->t('<span class="uw-search--checkboxlabel--labeltext">Search Checkbox</span>'),
'#label_classes' => [
'uw-search--checkboxlabel',
],
......@@ -42,6 +42,7 @@ class UwSearchForm extends FormBase {
'uw-input',
'uw-input--checkboxform',
],
'aria-hidden' => 'true',
],
'#theme_wrappers' => [],
];
......@@ -53,12 +54,13 @@ class UwSearchForm extends FormBase {
// label.
$form['label'] = [
'#theme' => 'form_element_label',
'#title' => $this->t('<span class="uw-search--checkboxlabel--labeltext"></span>'),
'#title' => $this->t('<span class="uw-search--checkboxlabel__labeltext">Open Search </span>'),
'#title_display' => 'after',
'#required' => FALSE,
'#id' => 'edit-opentray',
'#attributes' => [
'class' => ['uw-search--checkboxlabel'],
'aria-hidden' => 'true',
],
];
......@@ -70,8 +72,18 @@ class UwSearchForm extends FormBase {
],
'#id' => 'uw-search',
'#placeholder' => $this->t('Search'),
'#title' => $this->t('<span class="uw-search--labeltext">Search Text </span>'),
'#title_display' => 'invisible',
'#label' => [
'#theme' => 'form_element_label',
'#required' => FALSE,
'#id' => 'uw-search',
'#attributes' => [
'class' => ['uw-search--hidelabel'],
'aria-hidden' => 'true',
],
],
];
// Get the URL for this site to be used in the options.
$url = Url::fromRoute('<front>', [], ['absolute' => TRUE])->toString();
......@@ -86,6 +98,17 @@ class UwSearchForm extends FormBase {
'' => $this->t('On all sites'),
'inurl:' . $url => $this->t('On this site'),
],
'#title_display' => 'invisible',
'#title' => $this->t('Select Label'),
'#label' => [
'#theme' => 'form_element_label',
'#required' => FALSE,
'#id' => 'uw-select-site',
'#attributes' => [
'class' => ['uw-search--hidelabel'],
'aria-hidden' => 'true',
],
],
];
// The submit button.
......@@ -93,6 +116,7 @@ class UwSearchForm extends FormBase {
$form['actions']['submit'] = [
'#type' => 'submit',
'#attributes' => [
'value' => $this->t('Search'),
'class' => [
'button',
'button--submit',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment