Find radio group value
- From: Max <Maxime.Plante@xxxxxxxxx>
- Date: Fri, 31 Aug 2007 08:31:34 -0700
Hello group,
I use this function to find the value of a radio group:
function valButton(btn) {
var cnt = -1;
for (var i=btn.length-1; i > -1; i--) {
if (btn[i].checked) {cnt = i; i = -1;}
}
if (cnt > -1) return btn[cnt].value;
else return null;
}
I however found an incompatibility with Internet Explorer, when the
radio group name contains brackets. For example, the radio group name
is '1234[a]'. The Ms Script Debugger stops on btn.length, saying that
it is null or not an object. You may also want to know that it works
well in Firefox and Safari.
Does anyone knows any way I can get IE to digest this? Do you know
another way to acquire radio group value?
Thanks,
Max
.
- Prev by Date: Information on Customatix.com web app
- Next by Date: Advice: how best to create an image
- Previous by thread: Information on Customatix.com web app
- Next by thread: Advice: how best to create an image
- Index(es):