js方法:
function check(){
var name = document.getElementById("name").value;
if(name == null || name == ''){
alert("用户名不能为空");
return false;
}
return true;
}
不能用submit,只能用button,定义一个button的onclick事件
写一个javascript,在js中验证和实现跳转就可以了,
例如:
function haha(){
window.location="index.html";
}