How to get in javascript radio's value it?

Category: Web Develop
 
purple1984
2011-04-08 11:18:47

Sponsored Links
<input/> type is text ah, there <select/> can use window.document.formname.objname.value get value, but <input type = radio name = ra1 value = 1 ;/> this way to get any.
ask how to get to it?
Thank

Sponsored Links

kay226
2011-04-08 11:30:05
form.ra1.value not do it?
bowentian
2011-04-08 11:47:15
form.ra1.value not ah
sekiryou
2011-04-08 12:04:27
dynamically obtain this you have to, you can do an experiment document.formname.objname [1]. value written this way can get it.
accpa619
2011-04-08 12:14:21
If there is only one <input type="radio" name="radioName" value="value1"> words,
document.forms [0] . radioName.value radio can be taken to the value of value1.
If there are multiple radio,
<input type="radio" name="radioName" value="value1">
<input type = "radio" name = "radioName" value = "value2">
that document.forms [0]. radioName is actually an array,
by
var test = document.forms [0]. radioName;
var len = test.length;
for (var i = 0; i < ; len; i + +) {
if (test [i]. checked == true) {
alert (test [ i]. value);
}
} to get you selected a single marquee value.
ysm19851123
2011-04-08 12:31:31
Upstairs positive solutions

Domain and server ip had changed since 8/23/2013. Suspend the user registration and posts for program maintenance.