I have a for statement in my validation process
I do a for loop becasue I don't know how many rows of items there are...I
need to validate each item in each row.
If I remove the "document.f orms[0].submit(); it works perfectly...the code
stops at each field that is not formated properly...but never submits.
However if I leave the submit() in there, the page submits before they have a
chance to fix problems.
How can I get both to work properly?
function validate(){
for(i=1;i<=rows ;i++){
if(column 1 is formated right){
alert("message" );
here.focus();
}
if (column 2 is formated right){
alert("message" );
here.focus();
}
document.forms[0].submit();
}
I do a for loop becasue I don't know how many rows of items there are...I
need to validate each item in each row.
If I remove the "document.f orms[0].submit(); it works perfectly...the code
stops at each field that is not formated properly...but never submits.
However if I leave the submit() in there, the page submits before they have a
chance to fix problems.
How can I get both to work properly?
function validate(){
for(i=1;i<=rows ;i++){
if(column 1 is formated right){
alert("message" );
here.focus();
}
if (column 2 is formated right){
alert("message" );
here.focus();
}
document.forms[0].submit();
}
Comment