Home >Backend Development >PHP Tutorial >用PHP处理多个同名复选框_PHP

用PHP处理多个同名复选框_PHP

WBOY
WBOYOriginal
2016-06-01 12:34:27948browse
如果一个表单中有多鐾囱】颍谔峤坏絧hp时却只有一个值,而并不像asp那样是一串用逗号分割的值。有一个很简单的方法来解决:将复选框的name后面加上[],例如: 改为:。这样php将得到一个叫ccc的阵列。但这种方法有个问题,如果您要在客户端对复选框是否被选择、选择了几个用javascript来判断时,javascript会因为复选框的name中含有[]而出错。您可以在表单中加入一个隐含域,用javascript设置它的值。

 



...








...

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn