Article View: fj.lang.javascript
Article #20Re: radio
From: Satoshi Kudoh
Date: Tue, 31 Mar 1998 00:00
Date: Tue, 31 Mar 1998 00:00
39 lines
1407 bytes
1407 bytes
In article <6f8gvh$3bg$1@inukko.from40.or.jp>, kobamasa@from40.or.jp
(Masayuki Kobayashi) wrote:
>JavaScriptで、ラジオボタンの選択されているものを調べる
>方法はないのでしょうか。onClickを使わない方法で。
こんなのではだめでしょうか。
<html>
<head>
<title>RadioButton</title>
<script language="JavaScript">
<!--
function checkRadio(myRadio) {
for (var i=0; i<myRadio.length; i++) {
if (myRadio[i].checked) {
alert (myRadio[i].value + " is checked.");
}
}
}
//-->
</script>
</head>
<body>
<form name="f">
<input type=radio name="r" value="a">A<br>
<input type=radio name="r" value="b">B<br>
<input type=radio name="r" value="c">C<br>
<input type=button value="Check" onClick="checkRadio(document.f.r)">
</form>
</body>
</html>
______________________________________
Satoshi Kudoh <kudo3104@ics.co.jp>
__________ Frame-G DSP ICS Co., Ltd.__
Technical Details
Message-ID:
<kudo3104-3103980915070001@island.ics.co.jp>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<6f8gvh$3bg$1@inukko.from40.or.jp>Show Full Headers
Complete Article Headers
X-Google-Language: Japanese,JIS X-Google-Thread: 103a72,5ad845728a71c036,start X-Google-Attributes: gid103a72,public From: kudo3104@ics.co.jp (Satoshi Kudoh) Subject: Re: radio Date: 1998/03/31 Message-ID: <kudo3104-3103980915070001@island.ics.co.jp> X-Deja-AN: 339301413 References: <6f8gvh$3bg$1@inukko.from40.or.jp> Content-Type: text/plain; charset=iso-2022-jp Organization: DSP, ICS Co., Ltd. Mime-Version: 1.0 Newsgroups: fj.lang.javascript