每日随笔

验证格式问题

在jsp页面用script标签对传值进行判断,并进行弹窗提示

<script>
function check(){
if(document.getElementById('id').value.length!=8){
alert("学号或工号位数错误");
document.getElementById('id').focus();
return false;
}
return true;
}
</script>

posted @ 2020-12-07 21:30  不详·Christina  阅读(38)  评论(0)    收藏  举报