zoukankan      html  css  js  c++  java
  • 验证是否为空

     1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
     2 <html xmlns="http://www.w3.org/1999/xhtml">
     3 <head>
     4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
     5 <title>验证是否为空</title>
     6 <script type="text/javascript">
     7     function checkForm(yourinfo){
     8         if(yourinfo.namestring.value==""||yourinfo.namestring.value==null){
     9             alert("请输入你的名字");
    10             return(false);
    11         }
    12         else{
    13             return(true);
    14         }
    15     }
    16 </script>
    17 </head>
    18 
    19 <body>
    20 <form name="info" method="post" onSubmit="return checkForm(this);">
    21     <p>姓名:<input type="text" name="namestring" size="60"/></p>
    22     <p><input type="submit" value="提交" /> <input type="reset" value="重置" /></p>
    23 </form>
    24 </body>
    25 </html>
  • 相关阅读:
    vue 加载更多2
    vue 加载更多
    js获取浏览器信息
    iscroll
    git fetch
    input file accept类型
    git从安装到使用
    sass中的循环判断条件语句
    animation
    vue2+animate.css
  • 原文地址:https://www.cnblogs.com/52css/p/2642562.html
Copyright © 2011-2022 走看看