Connecting javascript's

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?!!

try something like this

form action=“Submitform()”

and then

function Submitform(){
validate = ValidateForm()
if (validate == “true”)
{form.action = “anotherpage.html”
form.submit();}
else
{ alert(“ERROR”);}
}

function validate(){

}

now in validate you have your validation code and then try when your happy with the fields you’ve validated you put

validate = “true” or “false”

then in the other function the validate field takes the value you’ve returned from the other function…I think

this is from memory and if it doesn’t work, sorry. Any problems try www.w3schools.com they usually have all the answers :thumb: