non mi va... aiutino?

codice:
function validateForm() {
var name = document.forms[0].name;
var email = document.forms[0].email;
var confirmemail = document.forms[0].confirmmail;
var errorstring = "";
	if (name = "") {
		errorstring = errorstring + "- Your name is required";
	}
	if (email = confirmemail) {
		//good
	} else {
		errorstring = errorstring + "- Your email address does not match";
	}
if (errorstring = "") {
		document.forms[0].submit();
	} else {
		alert ("Error: " + errorstring);
	}
}