Email Validation Problem

Hello folks, hope you are all well!
With many thanks to everyone who critiqued my site, Ive been trying to get an email validation working for my form. It works great locally within flash preview, but not locally via its html window, or live. Im not a coder & am self taught to the code will be pretty shabby! (trial & error type gal!)

This is on my send btn,

 
on (release) {
 
  if (form.name == null && form.email == null && form.message == null) {
        errmsg = "oooh, you didnt write anything";
    } else if (form.name == null) {
        errmsg = "please enter name";
    } else if (form.email == null) {
        errmsg = "valid email please";
    } else if (form.message == null) {
        errmsg = "theres no message yet";
    } else if (form.email.indexOf("@") == -1 || form.email.indexOf(".") == -1 || form.email.indexOf("com") == -1) {
        errmsg = "invalid email address";
    } else {
        // send variables in form movieclip (the textfields)
 // to email PHP page which will send the mail
 form.loadVariables("feedback.php", "POST");
 nextFrame();
 delete errmsg;
    }
}
 

When live it doesnt allow sending if the criteria arent met, but doesnt display the error messages either, any advice very welcome!

scotia :slight_smile: