内容为空弹出提示框
2015-08-21 17:29
447 查看
<!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=" 搜索 " >
</div>
</form>
</body>
</html>
<script type="text/javascript">
function comfirm()
{
if(document.sousuo.game_name.value=="")
{
alert("内容不能为空");
return false;
}
return true;
}
</script>
<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=" 搜索 " >
</div>
</form>
</body>
</html>
<script type="text/javascript">
function comfirm()
{
if(document.sousuo.game_name.value=="")
{
alert("内容不能为空");
return false;
}
return true;
}
</script>
相关文章推荐
- 欢迎使用CSDN-markdown编辑器
- MyBatis的动态SQL详解
- HTML5开发 web storage
- eclipse自动补全
- iOS本地推送与远程推送
- C#中的重写和覆盖的区别
- C# foreach 中获取索引index的方法
- php裁剪图片
- httpmime-4.1.3.jar和httpmime-4.3.6.jar 发送的http请求有差异,导致服务端无法接收到数据。
- HDU 1172 猜数字
- Netty之BIO(同步阻塞IO)、PIO(伪异步阻塞IO)、NIO(异步非阻塞IO)、AIO(异步非阻塞IO)、Netty
- web 小票打印插件
- DB2将一列数据拼接成一个字符串(转自百度知道)
- Oracle关于时间/日期的操作
- 反向代理
- 【开学季】自学嵌入式开发|四核开发板|4412开发板|ARM+Android+linux技术
- 线程4:原子变量与原子操作
- POJ_1067 取石子游戏(Wythoff Game)
- 【NOI2006 Day2 T1】最大获利
- 第0章 前言知识