<style type="text/css">
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
background="../src/back.gif";
}
</style>
<script language="JavaScript">
function formCheck()
{
alert()
if(leaMsgBoard.oname.value==""){
alert("请输入你的姓名!");
leaMsgBoard.oname.focus();
return false;
}
if(leaMsgBoard.oclass.value==""){
alert("请输入你的班级!");
leaMsgBoard.oclass.focus();
return false;
}
if(leaMsgBoard.contact.value==""){
alert("请填入你的电子邮件!");
leaMsgBoard.contact.focus();
return false;
}
}
</script>
<form action="setMsg.jsp" method="post" name="leaMsgBoard" onsubmit="return formCheck();" >
<table width="700" border="0" align="center" cellpadding="4" 1" bgcolor="#ebcellspacing="ebeb">
<tr>
<td>
<br>姓名: <input type="text" name="oname" size="12">
<p>班级: <input type="text" name="oclass" size="12"> </p>
<P>联系方式: <input type="text" name="contact" size="20"> </p>
<input type="submit" name="SubmitBtn" value="确认">
</td> </tr> </table>
</form>
很简单的问题 把你的<style>拿到<script>标签外面即可 还有别以关键字命名