in my experience
function reportFormElements(obj) {
for (var i = 0; i < obj.length; i++) {
if (obj.elements[i].type == 'checkbox') {
alert(obj.elements[i].checked);
}
else {
alert(obj.elements[i].value);
}
}
}
The basic gist is, for each actual form element in the form, look at the value of the form element and alert that value. If it's a checkbox, then investigate the 'checked' attribute.
There are several ways to do this sort of thing, and one of them reports the value of each child node in the named form, including text nodes, html nodes. We don't want that, and only want to interrogate the actual form elements. A sample form is below, go ahead and try it...