内容为空弹出提示框

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title></title>
    </head>
    <body>
        

<form name="sousuo" action="ss.php" id="sousuo" method="post"  onsubmit="return comfirm()">

<div style="margin:50px"><h2  style=" color:#C60; float:left; margin:30px 10px 30px 30px">请填写游戏名称:</h2><input  type="text" name="game_name" style=" margin:30px 30px 30px 0px" maxlength="100" >
<input type="submit" value="&nbsp;搜索&nbsp;" >
</div>

</form>
</body>
</html>

<script type="text/javascript">
function comfirm()
{
    if(document.sousuo.game_name.value=="")
    {
    alert("内容不能为空");
    return false;
   
    }
    return true;
   
    }
</script>

posted on 2015-08-21 17:29  求知的木头  阅读(640)  评论(0编辑  收藏  举报

导航