表单提交时通过JavaScript判断哪个radio按钮被选中了
<script type="text/javascript"> function findButton() { var myForm = document.forms.animalForm; var i; for(i=0;i<myForm.marsupial.length; i++) { if(myForm.marsupial[i].checked) { break; } } alert("You selected \""+myForm.marsupial[i].value+"\"."); } </script> <form name="animalForm"> <input type="radio" name="marsupial" value="kangaroo" />75271.com <br /><input type="radio" name="marsupial" value="Opossum" />Opossum <br /><input type="radio" name="marsupial" value="Tasmanian Tiger" />Tasmanian Tiger <br /> <input type="button" name="GO" value="GO" onclick="findButton()" /> </form>