Checkbox automatically add tags ‘[]’ after its name
-
Hi,
I got an issue with that : in order to validate a form, I created a script which call the names of all input which has the type ‘checkbox’, remove the occurences, and verify if at least one checkbox of a group is checked.
At this moment my script returned an error that let me show that the CF7 checkboxes automatically add tags [] after their name. I didn’t find why…
Here’s an example of my input :
[checkbox* sample "Red" "Blue" "Yellow"]
That’s what we got :
<span class="wpcf7-form-control-wrap sample"> <span class="wpcf7-form-control wpcf7-checkbox wpcf7-validates-as-required"> <span class="wpcf7-list-item first"> <input name="sample[]" value="Red" type="checkbox"><span class="wpcf7-list-item-label">Red</span> </span> <span class="wpcf7-list-item"> <input name="sample[]" value="Blue" type="checkbox"><span class="wpcf7-list-item-label">Blue</span> </span> <span class="wpcf7-list-item"> <input name="sample[]" value="Yellow" type="checkbox"><span class="wpcf7-list-item-label">Yellow</span> </span> </span> </span>
The name of my checkboxes became “sample[]” instead of “sample” as we wrote it.
In the future, it will also be difficult to manage for me because I need to create huge forms and pass them trough a third party system, which will collect the data to relay them in another back-office. So, I need to be able to use the exact terms…
Can you help me on this way ?
Thank you in advance
- The topic ‘Checkbox automatically add tags ‘[]’ after its name’ is closed to new replies.