Skip to content

Commit

Permalink
Fixed issue: avoid very rare possible duplicate id on a page
Browse files Browse the repository at this point in the history
  • Loading branch information
LouisGac committed Jun 15, 2017
1 parent 3595a20 commit 648429f
Showing 1 changed file with 4 additions and 4 deletions.
Expand Up @@ -17,19 +17,19 @@ class="radio"
type="radio"
value="<?php echo $code; ?>"
name="<?php echo $name; ?>"
id="answer<?php echo $name.$code; ?>"
id="answer<?php echo $name.'s'.$code; ?>"
<?php echo $checkedState;?>
onclick="if (document.getElementById('answer<?php echo $name; ?>othertext') != null) document.getElementById('answer<?php echo $name; ?>othertext').value='';checkconditions(this.value, this.name, this.type)"
aria-labelledby="label-answer<?php echo $name.$code; ?>"
aria-labelledby="label-answer<?php echo $name.'s'.$code; ?>"
/>
<label for="answer<?php echo $name.$code; ?>" class="control-label radio-label"></label>
<label for="answer<?php echo $name.'s'.$code; ?>" class="control-label radio-label"></label>

<!--
The label text is provided inside a div,
so final user can add paragraph, div, or whatever he wants in the subquestion text
This field is related to the input thanks to attribute aria-labelledby
-->
<div class="label-text label-clickable" id="label-answer<?php echo $name.$code; ?>">
<div class="label-text label-clickable" id="label-answer<?php echo $name.'s'.$code; ?>">
<?php echo $answer; ?>
</div>
</div>
Expand Down

0 comments on commit 648429f

Please sign in to comment.