Qualcuno mi sa spiegare perchè in questo script:
<?xml version = "1.0"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv = "Content-Script-Type" content ="text/javascript">
<meta http-equiv = "content-type" content = "text/html;charset = iso-8859-1" />
<script>
var boxData="Data passed are: ";
function proof(){
for(i=0;i<document.checkForm.length;i++){
if(document.checkForm.test[i].checked){
boxData+=document.checkForm.test[i].value+"; ";
}
}
alert(boxData);
}
</script>
<title>
</title>
</head>
<body>
<form name="checkForm" onSubmit="proof()">
Test<input type="checkbox" name="test" selected value="TEsT" />
Test2<input type="checkbox" name="test" value="TEsT2"/>
<input type="submit" value="testtesttest" />
</form>
</body>
</html>

...l'alert non funziona ? se lo sposto all'interno del loop o fuori dalla funzione ovviamente va, ma là dov'è ora non parte...