I wrote this function to tell the user that the field that they forget to fill out is required, it works but for only a second and then it disappears?
function proc(){
var errmsg = "";
if (document.forms["newUser"]["fName"].value == "")
{
errmsg += "*This field is required";
document.getElementById('first_name_error').innerHTML = errmsg;
}
Why is it only writting to the form page for a less than a second?
The form is probably submitting and reloading. If you are running validation from a submit handler, have the function return false to stop submit: