Hi everybody, I am still working on a form that suppose to validate it self and proceed only if all that text fields are filled with the correct words. here is what I am working on. I ve got two scripts that kirupa forum members gave me, but I don’t know how to connect them to a form and make everything work
here are java scripts:
function FormSubmit(){
f = self.textbox.value;
if (f == "whatever")
{ alert("Pass") }
else
{ alert("Fail"); }
}
and then in the form action you declare
form action="javascript: FormSubmit()"
and another array:
corrects = [“hello”,“yes”,etc];
//and check all the text fields with one function:
function validate(){
for(i=0;i <corrects.length;++i){
if(corrects*!=document.yourForm.elements*.value){ return (false);
break;}
return (true);
document.yourForm.submit();}}
Can anyone help?!!