dev/accessiblity#3 Add aria-label to form elements of contribution page which don't have accessible labels
$form->add('checkbox', 'is_recur', ts('I want to contribute this amount'), NULL);
if (!empty($form->_values['is_recur_interval']) || $className == 'CRM_Contribute_Form_Contribution') {
- $form->add('text', 'frequency_interval', ts('Every'), $attributes['frequency_interval']);
+ $form->add('text', 'frequency_interval', ts('Every'), $attributes['frequency_interval'] + ['aria-label' => ts('Every')]);
$form->addRule('frequency_interval', ts('Frequency must be a whole number (EXAMPLE: Every 3 months).'), 'integer');
}
else {
}
}
}
- $frequencyUnit = &$form->add('select', 'frequency_unit', NULL, $units);
+ $frequencyUnit = &$form->addElement('select', 'frequency_unit', NULL, $units, ['aria-label' => ts('Frequency Unit')]);
}
// FIXME: Ideally we should freeze select box if there is only
$form->addRadio('is_pledge', ts('Pledge Frequency Interval'), $pledgeOptions,
NULL, array('<br/>')
);
- $form->addElement('text', 'pledge_installments', ts('Installments'), array('size' => 3));
+ $form->addElement('text', 'pledge_installments', ts('Installments'), ['size' => 3, 'aria-label' => ts('Installments')]);
if (!empty($pledgeBlock['is_pledge_interval'])) {
$form->assign('is_pledge_interval', CRM_Utils_Array::value('is_pledge_interval', $pledgeBlock));
- $form->addElement('text', 'pledge_frequency_interval', NULL, array('size' => 3));
+ $form->addElement('text', 'pledge_frequency_interval', NULL, ['size' => 3, 'aria-label' => ts('Frequency Intervals')]);
}
else {
$form->add('hidden', 'pledge_frequency_interval', 1);
$freqUnits[$val] = !empty($pledgeBlock['is_pledge_interval']) ? "{$frequencyUnits[$val]}(s)" : $frequencyUnits[$val];
}
}
- $form->addElement('select', 'pledge_frequency_unit', NULL, $freqUnits);
+ $form->addElement('select', 'pledge_frequency_unit', NULL, $freqUnits, ['aria-label' => ts('Frequency Units')]);
// CRM-18854
if (CRM_Utils_Array::value('is_pledge_start_date_visible', $pledgeBlock)) {
if (CRM_Utils_Array::value('pledge_start_date', $pledgeBlock)) {
<div class="label">{$form.$paymentField.label}
{if $requiredPaymentFields.$name}<span class="crm-marker" title="{ts}This field is required.{/ts}">*</span>{/if}
</div>
- <div class="content">{$form.$paymentField.html}
+ <div class="content">
+ {$form.$paymentField.html}
{if $paymentField == 'cvv2'}{* @todo move to form assignment*}
<span class="cvv2-icon" title="{ts}Usually the last 3-4 digits in the signature area on the back of the card.{/ts}"> </span>
{/if}
{assign var='hideTotal' value=$quickConfig+$noCalcValueDisplay}
<div id="pricesetTotal" class="crm-section section-pricesetTotal">
<div class="label
- {if $hideTotal}, hiddenElement{/if}" id="pricelabel">
- <label>
- {if ( $extends eq 'Contribution' ) || ( $extends eq 'Membership' )}
- <span id='amount_sum_label'>{ts}Total Amount{/ts}{else}{ts}Total Fee(s){/ts}</span>
- {if $isAdditionalParticipants} {ts}for this participant{/ts}{/if}
- {/if}
- </label>
+{if $hideTotal}, hiddenElement{/if}" id="pricelabel">
+ {if ( $extends eq 'Contribution' ) || ( $extends eq 'Membership' )}
+ <span id='amount_sum_label'>{ts}Total Amount{/ts}{else}{ts}Total Fee(s){/ts}</span>
+ {if $isAdditionalParticipants} {ts}for this participant{/ts}{/if}
+ {/if}
</div>
<div class="content calc-value" {if $hideTotal}style="display:none;"{/if} id="pricevalue" ></div>
</div>