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

Generate form elements with same name attribute #245

Merged
merged 1 commit into from
Jun 7, 2014

Conversation

burakcakirel
Copy link
Contributor

Issue :
Fancytree Options: checkbox = true

When fancytree embed in form and select one or more node from tree, it is generated form elements with the same name attribute. Please see the below
<_input type="checkbox" name="ft_1" value="node1" checked="checked">
<_input type="checkbox" name="ft_1" value="node3" checked="checked">

This causes that when the form post to the server, there is one value in $_POST global variable.
Solution :
If we change it's name attribute to "ft_1[]", all values are in array called "ft_1" in $_POST

<input type="checkbox" name="ft_1" value="node1" checked="checked">
<input type="checkbox" name="ft_1" value="node3" checked="checked">

This causes that when the form post to the server, there is one variable in $_POST global variable.

If we change it's name attribute to "ft_1[]", all variables are in array in $_POST
@mar10
Copy link
Owner

mar10 commented Jun 4, 2014

Thanks for sharing this.
I am not sure how this would affect non-php servers, so I asked here: http://stackoverflow.com/questions/24043234/should-i-append-to-multiple-html-checkboxes

to find out if we should make this configurable.

mar10 added a commit that referenced this pull request Jun 7, 2014
Generate form elements with same name attribute (fix for PHP)
@mar10 mar10 merged commit 9e720cc into mar10:master Jun 7, 2014
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.

2 participants