Why does this code alert three undefined values?
<html>
<head>
<script type="text/javascript" language="javascript">
function doIt(form){
alert(form.elements.length)
for (var i in form.elements){
alert(form.elements[i].value);
}
}
</script>
</head>
<body id="body">
<form method="GET" action="http://localhost/sandbox/moving/controllers/companies/cSubmit_bid.php">
<input type="button" value="Go" onclick="doIt(this.form)">
</form>
</body>
</html>
Thank you in advance.