admin管理员组文章数量:1356092
I have a set of check-boxes, which under certain conditions have their DIV container element hidden.
The problem is that values from these check-boxes are not sent through $_POST
when they are not visible. How can I force them to be sent?
I have a set of check-boxes, which under certain conditions have their DIV container element hidden.
The problem is that values from these check-boxes are not sent through $_POST
when they are not visible. How can I force them to be sent?
- how are you imposing invisibility? are you removing them from the html? visiblility:hidden? or display:none? and what data are contained and why are they hidden? – Joseph Commented Nov 18, 2011 at 20:03
- 4 Checkboxes are not sent unless they are checked – Laurence Burke Commented Nov 18, 2011 at 20:04
- I'm not hiding them directly, I'm just hiding their container with $(el).hide(). This is what is confusing me... – Alex Commented Nov 18, 2011 at 20:06
- Are you using AJAX to post the data to the server? – zzzzBov Commented Nov 18, 2011 at 20:10
- 1 yes, I'm using serialize() to get the form fields data... – Alex Commented Nov 18, 2011 at 20:19
2 Answers
Reset to default 9It is not the visibility that is affecting if you can see the checkbox values. Checkbox values are not sent if the checkbox is not checked.
If the value does not exist in $_POST it has not been checked.
http://www.html-form-guide./php-form/php-form-checkbox.html
.hide() set the diplay to none;
visibility:hidden would work.
$(el).css('visibility', 'hidden');
本文标签: phpHidden checkbox input values are not sent (Stack Overflow
版权声明:本文标题:php - Hidden checkbox input values are not sent :( - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1743989683a2571905.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论