Skip to content

Commit

Permalink
Fixed issue #08782: "Option 'Other'" for multiple choice is not 508 c…
Browse files Browse the repository at this point in the history
…ompliant

Dev: section 508 : All visible INPUT elements must have a label, either by using a linked or containing LABEL element, or by using the ALT or TITLE attribute. Buttons are considered to be self-labeling.
Dev: visibility:hidden + title get the 508
Dev: Add aria-hidden property when remove the visibility to be more ususable for browser with aria technologie
  • Loading branch information
Shnoulle committed Feb 28, 2014
1 parent db928b8 commit 3d1b9b3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions application/helpers/qanda_helper.php
Expand Up @@ -2404,7 +2404,7 @@ function do_multiplechoice($ia)
}
$answer .= $startitem;
$answer .= $hiddenfield.'
<input class="checkbox other-checkbox" style="visibility:hidden" type="checkbox" name="'.$myfname.'cbox" alt="'.$clang->gT('Other').'" id="answer'.$myfname.'cbox"';
<input class="checkbox other-checkbox" style="visibility:hidden" type="checkbox" name="'.$myfname.'cbox" title="'.$clang->gT('Other').'" id="answer'.$myfname.'cbox"';
// othercbox can be not display, because only input text goes to database

if (isset($_SESSION['survey_'.Yii::app()->getConfig('surveyID')][$myfname]) && trim($_SESSION['survey_'.Yii::app()->getConfig('surveyID')][$myfname])!='')
Expand All @@ -2425,7 +2425,7 @@ function do_multiplechoice($ia)
}
$answer .="\" />";
$answer .="<script type='text/javascript'>\n";
$answer .="$('#answer{$myfname}cbox').css('visibility','');";
$answer .="$('#answer{$myfname}cbox').prop('aria-hidden', 'true').css('visibility','');";
$answer .="$('#answer{$myfname}').bind('keyup focusout',function(event){\n";
$answer .= " if ($.trim($(this).val()).length>0) { $(\"#answer{$myfname}cbox\").prop(\"checked\",true); } else { \$(\"#answer{$myfname}cbox\").prop(\"checked\",false); }; $(\"#java{$myfname}\").val($(this).val());LEMflagMandOther(\"$myfname\",$('#answer{$myfname}cbox').is(\":checked\")); $oth_checkconditionFunction(this.value, this.name, this.type); \n";
$answer .="});\n";
Expand Down

0 comments on commit 3d1b9b3

Please sign in to comment.