jsæ¹æ³ï¼
function check(){
var name = document.getElementById("name").value;
if(name == null || name == ''){
alert("ç¨æ·åä¸è½ä¸ºç©º");
return false;
}
return true;
}
<form name="form" action="跳转ç页é¢" method="post" onsubmit="return check()">
<input type="text" id="name"/>
<input type="sumit" value="æ交"/>
</form>
温馨提示:答案为网友推荐,仅供参考