Q
QSmile
Unregistered / Unconfirmed
GUEST, unregistred user!
我这样做的,但得不到值,只得到 "undefined"
<html>
<head>
</head>
<body>
<form id="form1" name="form1" action="#" method="GET">
<li>请选择<br>
<input type="radio" name="vote" value="1" checked> aaaaa <br>
<input type="radio" name="vote" value="2"> bbbbb <br>
<input type="radio" name="vote" value="3"> ccccc <br>
<input type="button" value="xxx" onClick="javascript:
alert(document.form1.vote.value);
">
</form>
<form id="form2" name="form2" action="#" method="GET">
<p>请选择</p>
<input type="checkbox" name="vote" value="1" > aaaaa <br>
<input type="checkbox" name="vote" value="2" > bbbbb <br>
<input type="checkbox" name="vote" value="3" > ccccc <br>
<input type="button" value="xxx" onClick="javascript:
alert(document.form2.vote.value);
">
</form>
</body>
</html>
<html>
<head>
</head>
<body>
<form id="form1" name="form1" action="#" method="GET">
<li>请选择<br>
<input type="radio" name="vote" value="1" checked> aaaaa <br>
<input type="radio" name="vote" value="2"> bbbbb <br>
<input type="radio" name="vote" value="3"> ccccc <br>
<input type="button" value="xxx" onClick="javascript:
alert(document.form1.vote.value);
">
</form>
<form id="form2" name="form2" action="#" method="GET">
<p>请选择</p>
<input type="checkbox" name="vote" value="1" > aaaaa <br>
<input type="checkbox" name="vote" value="2" > bbbbb <br>
<input type="checkbox" name="vote" value="3" > ccccc <br>
<input type="button" value="xxx" onClick="javascript:
alert(document.form2.vote.value);
">
</form>
</body>
</html>