val value = document.getElementByName()
//判断是否为空
if(isNull(value)){
alert("不能为空")
}
提交成功后设置隐藏标签为成功状态,每次提交获取提交状态,当状态为成功时,发出alert()提示,流程大概就是这样的
b.html里这么写<form action="a.html" method="get">
<input type="text" name="username" />
<input type="submit" value="post" />
</form>
在文本框输入一些东西后点下按钮就可以提交到a.html里了,你也可以看到地址栏里后面跟了一串数据:?username=文本里填的东西;
但是要通过js取出这个数据的话,得用到jsp里面的内置对象 request,调用request.getParameter("username") 就能去到文本框里写的东西了。所以html文件取不到,得用jsp