Mat55
02-16-2012, 04:07 AM
So I made a form in html and whenever I type something in my textfields and it shows error messages, after that it refreshes (or resets) and clears all the text I wrote in the text fields.
But when I type in onsubmit = "return validate()", than it duplicates my error messages but it does not clear my form
I am guessing my problem is in the html so I will show you it.
<form id="assignment" name="assignment" method="post" action= "" onsubmit = "return validate()">
<input type="submit" value="Submit" />
and on my code the ending goes like this:
if(message != "")
{
alert(message);
return false;
}
else
{
return true;
}
}
Thanks alot!
But when I type in onsubmit = "return validate()", than it duplicates my error messages but it does not clear my form
I am guessing my problem is in the html so I will show you it.
<form id="assignment" name="assignment" method="post" action= "" onsubmit = "return validate()">
<input type="submit" value="Submit" />
and on my code the ending goes like this:
if(message != "")
{
alert(message);
return false;
}
else
{
return true;
}
}
Thanks alot!