Javascript 如何保存未选中的动态复选框数组?
我有一个html代码,它有用户想要的尽可能多的副本,通过一个按钮添加另一组Javascript 如何保存未选中的动态复选框数组?,javascript,php,html,checkbox,Javascript,Php,Html,Checkbox,我有一个html代码,它有用户想要的尽可能多的副本,通过一个按钮添加另一组 <input type="email" class="regular-text" id="customer_email_address[]" name="customer_email_address[]" placeholder="Email Address" /> <input type="text" class="regular-text" id="customer_email_password[]
<input type="email" class="regular-text" id="customer_email_address[]" name="customer_email_address[]" placeholder="Email Address" />
<input type="text" class="regular-text" id="customer_email_password[]" name="customer_email_password[]" placeholder="Password" />
<input type="checkbox" id="customer_email_create[]" name="customer_email_create[]" />
我的问题是,虽然我可以保存用PHP选中的复选框,但我无法确定哪些复选框是未选中的
我该如何做这样的事情呢?例如,您可以检查
客户\u电子邮件\u创建
价值。如果为空,则复选框未选中提交
编辑:
因为这些值是数组,所以在每次数据更新时,您必须删除数据库中所有相关数据,并从POST请求中添加新数据。在JS或POST表单提交中?试试这里的建议我已经尝试过了,但它似乎不适用于数组版本,因为我想不出一种方法来唯一地命名复选框,问题是这是一个由这3个字段组成的数组。如果其中一个被选中,我可以检查它,但我无法知道它连接到了哪一组输入。检查我的答案。