我的表单中有以下复选框,id想要知道如何检查至少其中一个选中状态,而不更改它们的名称。检查值是否存在
<label for="branding">Branding
<input type="checkbox" name="branding" id="branding" class="checkbox" /></label>
<label for="print">Print
<input type="checkbox" name="print" id="print" class="checkbox" /></label>
<label for="website">Website
<input type="checkbox" name="website" id="website" class="checkbox" /></label>
<label for="other">Other
<input type="checkbox" name="other" id="other" /></label>
您甚至可以使用布尔值而不是整数,或者只使用if(this || that || foo || bar){} 为什么不能重写表单? – Emyr 2009-12-03 16:43:13
你知道这段代码会在你的日志文件中产生很多警告吗? – Yacoby 2009-12-03 17:43:34