Skip to content

Fix input choice id replacement#44

Open
ajoah wants to merge 1 commit intotyxla:masterfrom
ajoah:patch-2
Open

Fix input choice id replacement#44
ajoah wants to merge 1 commit intotyxla:masterfrom
ajoah:patch-2

Conversation

@ajoah
Copy link
Copy Markdown
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.

1 participant