Contact Form - Checking the fields

Hey guys, I wanted to make a contact form which checks all the fields to see if they are empty or have their defualt values still, code is as follows… but it doesn’t work:

on (release) {
	// Define the default string values for the inputs.
nameboxdefault = "Enter your full name here.";
emailboxdefault = "Enter a valid e-mail address here.";
companyboxdefault = "Enter your company's name here.";
commentsboxdefault = "Enter any comments you have here.";
// Set the variable that allows the data to be sent.
okaytosend = 1;
//Process all the forms. If one is unsatisfactory, the field must be edited to be satisfactory
//and then the button must be reclicked.
    if (_root.form.namebox.text == nameboxdefault || _root.form.namebox.text == ""){ 
        _root.form.namebox.text = nameboxdefault;
		okaytosend = 0;
    } 

    if (_root.form.emailbox.text == emailboxdefault || _root.form.emailbox.text == ""){ 
        _root.form.emailbox.text = emailboxdefault;
		okaytosend = 0;
    } 


    if (_root.form.companybox.text == companyboxdefault || _root.form.companybox.text == ""){ 
        _root.form.companybox.text = companyboxdefault;
		okaytosend = 0;
    } 


    if (_root.form.commentsbox.text == commentsboxdefault || _root.form.commentsbox.text == ""){ 
        _root.form.commentsbox.text = commentsboxdefault;
		okaytosend = 0;
    } 
	
	// If the allowing variable is true, send the information.
	if (okaytosend = 1) {
	form.loadVariables("email.php", "POST");
	}
}

Can you guys help? This code is on the submit button :wink: