Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix input choice id replacement #44

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

ajoah
Copy link
Contributor

@ajoah ajoah commented Oct 7, 2022

Hi,

The commit 5462839 breaks connection between label and input for choice fields.

Result :

<li class="gchoice gchoice_4_9_1">
	<input name="input_9" type="radio" value="par email" id="choice_1991267731_9_1">
	<label for="choice_1991267731_4_9_1" id="label_1991267731_4_9_1">par email</label>
</li>

id and for are not equal.

This PR fixes the issue.

However, i don't understant why the replacement is twice in the code :

			"for='choice_"                                                  => "for='choice_" . $random_id . '_',
			"id='label_"                                                    => "id='label_" . $random_id . '_',
			"id='choice_"                                                    => "id='choice_" . $random_id . '_',
			"for='input_" . $form['id'] . '_'                               => "for='input_" . $random_id . '_',
			"id='input_" . $form['id'] . '_'                                => "id='input_" . $random_id . '_',
			"id='choice_" . $form['id'] . '_'                               => "id='choice_" . $random_id . '_',

Only one group of these lines is necessary, no ?

@ajoah ajoah marked this pull request as ready for review October 7, 2022 11:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant