The form and text box were merely given as examples...they would be replaced by the form code that is already on your page. The form on the page in question is named form0.
Using the page you specified as an example, you would put the javascript function in the existing script tags at the top of the page. The javascript function is the one at the top of the code I provided:
CODE
function validateForm()
{
var strMessage = "Please fill in the following fields:\n";
var strError = "";
if(document.form0.FirstName.value == "")
strError += "First Name\n";
if(strError != "")
{
alert(strMessage + strError);
return(false);
}
else
{
return(true);
}
}
firstname would correspond to the input variable FirstName on the page you specified. The code given, when modified to check the new variable (FirstName instead of firstname) will ensure that something has been entered in that input box. the same process will have to be repeated for all variables that are mandatory. there are too many variables on that page for me to type out the code to, but the structure will look exactly the same as the first conditional (if) statement. If a mandatory field is not filled, put that field name in the error message. You'll notice that at the end, the function checks to see if there are any errors...if so, it displays them, and does not allow the user to submit. That is what the return value does...in the code of the form tag, which looks like this
CODE
<form name="form0" method="POST" action="http://urlmodifiedtoprotectfilesystems">
add the following
CODE
onSubmit="return(validateFunction());"
If all the mandatory fields are complete, it will allow the user to submit the form...if not, it will not allow the submit, forcing the user to fill in the missing fields.
Try it first just checking the FirstName variable...if you can get that working, you can do it all...let me know if you have any problems. And don't worry if you don't get it right away...these concepts take a little getting used to. I'm sure you'll have it in no time. Have a great night.