I need help!!!!! Aaaahhh!!!

wxdqz

New Member
Ok, I have tried and tried and tried! This code I wrote keeps on giving me errors! What I need to do with it is have it check a text box for a word, and if the word matches the variable I made then it sends the form, otherwise it doesn't and displays an error box saying it was an incorrect code. Here is the code, someone please help me.

<SCRIPT language = "JavaScript">
var code = "check";
var get_code = document.f1.code.value;
function check_code()
{
if (code == get_code)
{
return true;
}
else
{
return false;
window.alert("Incorrect recruitment code!");
}
}
</SCRIPT>

For clarification, f1 is the form name, code is the textbox name. Someone please help. Thanks ~ EaG|E
 
Back
Top