一:名稱不同,值可相同 ?
? ? ? <input ? type=checkbox ? name="a1" ? value="1">CPU ?
? ? ? <input ? type=checkbox ? name="a2" ? value="1">主板 ?
? ? ? <input ? type=checkbox ? name="a3" ? value="1">內存 ?
? 以名稱為依據的判斷: ?
? ? ? request.getParameter("a1")==null ?
? ?
? 二:名稱相同,值不同 ?
? ? ? <input ? type=checkbox ? name="a" ? value="1">CPU ?
? ? ? <input ? type=checkbox ? name="a" ? value="2">主板 ?
? ? ? <input ? type=checkbox ? name="a" ? value="3">內存 ?
? 以值為依據的判斷: ?
? ? ? String[] ? a ? = ? request.getParameterValues("a"); ?
? ? ? 看a數組中是否有相應的值。如果選中"CPU",則a[0]="1"??