I want to use a javascript to validate a form. After everything is all right, a confirm box pops up to ask whether the user wants to submit the form, if yes, the form is submitted and the database is updated, if no, no change to the database. I use <cfquery> (Cold Fusion) to updtate the database.
Currently the validation is working, but when I added the confirm box, it's not working. My logic is:
function upd_emp(f){
var name_err = false;
for loop here {
if (...){
name_err = true;
break;
}
} //for loop ends
if (name_err == true){
alert("error..."
;
return(false);
} else {
if (confirm("..."
){
return(true);
} else {
return(false);
}
}
}
}
Please let me know what's wrong with my logic...
Thanks in advance...
-J
Currently the validation is working, but when I added the confirm box, it's not working. My logic is:
function upd_emp(f){
var name_err = false;
for loop here {
if (...){
name_err = true;
break;
}
} //for loop ends
if (name_err == true){
alert("error..."
return(false);
} else {
if (confirm("..."
return(true);
} else {
return(false);
}
}
}
}
Please let me know what's wrong with my logic...
Thanks in advance...
-J