Wildcat
11-07-2003, 04:23 PM
I'm trying to get a form validation script running, and it keeps giving me the rather unhelpful "syntax errors" as the only error message. The form is a simple choice of radio buttons and a textarea, and when I seperate the pieces the javascript runs pretty well. But when I put it together it all goes nuts. Any help will be appreciated.
var fav = false;
var com = false;
function valid() {
for(i=0; i<9; i++) {
if (document.vote.char[i].checked) {
fav = true; }
}
if (document.vote.why.value != "") {
com = true; }
if (fav == true) && (com == true) {
return true; }
else { alert("Please fill out the entire form");
return false; }
}
var fav = false;
var com = false;
function valid() {
for(i=0; i<9; i++) {
if (document.vote.char[i].checked) {
fav = true; }
}
if (document.vote.why.value != "") {
com = true; }
if (fav == true) && (com == true) {
return true; }
else { alert("Please fill out the entire form");
return false; }
}