I'm not sure what the problem is 
The code below is your code with the [snip]s removed and your validation script prompts for both the name and email address if they are missing - but with your current code logic, only 1 at a time if both are missing.
The only thing I would normally do, but haven't done in your case, is put the opening and closing textarea tags on the one line.
Your code works fine in my IE8 and FF3.6
Maybe there is something else going on in your code that you haven't posted that is causing your problem.
PHP Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<script type="text/javascript">
function verify()
{
if(document.forms['formname'].aname1.value=="")
{
alert("Please enter your name");
document.forms['formname'].aname1.focus();
return false;
}
if(document.forms['formname'].gaddress.value=="")
{
alert("Please enter your mailing address");
document.forms['formname'].gaddress.focus();
return false;
}
else
return true;
}
</script>
</head>
<body>
<form action="#" id="formname" method="post" onsubmit="return verify()">
<table summary="" style="width:100%; cellpadding:0; cellspacing:0; border:0">
<tr>
<td class="td10">
Name
</td>
<td class="td90">
<input name="aname1" type="text" size="100%" />
</td>
</tr>
<tr>
<td class="td10">
Mailing<br />
Address
</td>
<td class="td90">
<textarea name="gaddress" rows="3" cols="87">
</textarea>
</td>
</tr>
</table>
<input type="submit" value="submit" />
</form>
</body>
</html>
Bookmarks