In article <B_jeb.50448$FN3.3503392@news.ono.com>,
phisys@netscape.net
enlightened us with...[color=blue]
> I want to know what's wrong with this code (I'm an amateur programmer).[/color]
I think it has a couple typos and doesn't check radio buttons right,
assuming you copied/pasted.
[color=blue]
> if(elm.type == "checkbox" || elm.type == "radio") {
> var passcheck = false;
> for(c = 0; c < frm[elm.name].lenght; c++)[/color]
length, not lenght.
{[color=blue]
> n = e + c;
> passcheck = passcheck || frm.element[n].checked;[/color]
frm.elements[n], not frm.element[n]
Can't check if it's checked this way for radio buttons.
Radio buttons are an array because they have the same name. Checkboxes
are not (unless more than one with same name).
Need array subscript for radio buttons. Loop through with another for
loop. Would be like
frm.elements[n][i].checked
for radios.
See archives and another post I made a few days ago on how to loop
through radio buttons.
-------------------------------------------------
~kaeli~
All I ask for is the chance to prove that money
cannot make me happy.
http://www.ipwebdesign.net/wildAtHeart http://www.ipwebdesign.net/kaelisSpace
-------------------------------------------------