Skip to content

Commit

Permalink
Fixed issue #08783: The main container form is not 508 compliant
Browse files Browse the repository at this point in the history
Dev: input id="runonce" are replaced by Expression manager function.
  • Loading branch information
Shnoulle committed Feb 28, 2014
1 parent d5889c7 commit 9fcd1dc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 13 deletions.
12 changes: 3 additions & 9 deletions application/helpers/SurveyRuntimeHelper.php
Expand Up @@ -995,15 +995,9 @@ function run($surveyid,$args) {
echo templatereplace(file_get_contents($sTemplatePath."survey.pstpl"), array(), $redata);
}

// the runonce element has been changed from a hidden to a text/display:none one
// in order to workaround an not-reproduced issue #4453 (lemeur)
echo "<input type='text' id='runonce' value='0' style='display: none;'/>";

# // lemradix and var for LemRadix
# $sLemRadixVarScript=" LEMradix='" . $radix . "';\n"
# ." numRegex = new RegExp('[^-' + LEMradix + '0-9]','g');\n"
# ." intRegex = new RegExp('[^-0-9]','g');\n";
# Yii::app()->clientScript->registerScript('LemRadixVarScript',$sLemRadixVarScript,CClientScript::POS_HEAD);
// runonce element has been changed from a hidden to a text/display:none one. In order to workaround an not-reproduced issue #4453 (lemeur)
// We don't need runonce actually (140228): the script was updated and replaced by EM see #08783 (grep show no other runonce)
// echo "<input type='text' id='runonce' value='0' style='display: none;'/>";

$showpopups=Yii::app()->getConfig('showpopups');
//Display the "mandatory" message on page if necessary
Expand Down
7 changes: 3 additions & 4 deletions application/helpers/qanda_helper.php
Expand Up @@ -2423,17 +2423,16 @@ function do_multiplechoice($ia)
}
$answer .= htmlspecialchars($dispVal,ENT_QUOTES);
}
$answer .="\" />";
$answer .="<script type='text/javascript'>\n";
$answer .="\" />\n";
$answer .="<script type='text/javascript'>\n/*<![CDATA[*/\n";
$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";
$answer .="$('#answer{$myfname}cbox').click(function(event){\n";
$answer .= " //if (($(this)).is(':checked')) { $(\"#answer{$myfname}\").focus(); } else { $(\"#answer{$myfname}\").val('');{$checkconditionFunction}(\"\", \"{$myfname}\", \"text\"); }; return true;\n";
$answer .= " if (($(this)).is(':checked') && $.trim($(\"#answer{$myfname}\").val()).length==0) { $(\"#answer{$myfname}\").focus();LEMflagMandOther(\"$myfname\",true);return false; } else { $(\"#answer{$myfname}\").val('');{$checkconditionFunction}(\"\", \"{$myfname}\", \"text\");LEMflagMandOther(\"$myfname\",false); return true; }; \n";
$answer .="});\n";
$answer .="</script>\n";
$answer .="/*]]>*/\n</script>\n";
$answer .= '<input type="hidden" name="java'.$myfname.'" id="java'.$myfname.'" value="';

// if ($maxansw > 0)
Expand Down

0 comments on commit 9fcd1dc

Please sign in to comment.