知识专栏
多方位、多角度、深度解读您所关心的问题

phpcms v9在线留言模板完整代码如下:

          <form method="post" action="{APP_PATH}index.php?m=formguide&c=index&a=show&formid=12&siteid=1" name="myform" id="myform" onSubmit="return check()">
            <div class="form-group">
              <label class="form-label"><span>*</span>您的姓名:</label>
              <div class="form-content">
                <input type="text" name="info[name]" id="name" class="form-control" placeholder="请输入">
              </div>
            </div>
            <div class="form-group">
              <label class="form-label"><span>*</span>您的手机:</label>
              <div class="form-content">
                <input type="text" name="info[mobile]" id="mobile" class="form-control" placeholder="请输入">
              </div>
            </div>
            <div class="form-group">
              <label class="form-label"><span>*</span>电子邮箱:</label>
              <div class="form-content">
                <input type="text" name="info[email]" id="email" class="form-control" placeholder="请输入">
              </div>
            </div>
            <div class="form-group">
              <label class="form-label"><span>*</span>公司名称:</label>
              <div class="form-content">
                <input type="text" name="info[gsmc]" id="gsmc" class="form-control" placeholder="请输入">
              </div>
            </div>
            <div class="form-group yzm">
              <label class="form-label"><span>*</span>验证码:</label>
              <div class="form-content">
                {php pc_base::load_sys_class('form', '', 0);}
                <input type="text" id="code" name="code" size="10" class="form-control" placeholder="请输入">
                {form::checkcode('code_img', '4', '14', 100, 30)}
            </div>
            </div>
            <div class="form-group full"> 
                <label class="form-label"><span>*</span>留言内容:</label>
                <div class="form-content"> 
                    <label class="form-radio">
                    <textarea name='info[neirong]' id='neirong' class="form-control" placeholder="请输入"></textarea>
                    </label>
                </div> 
            </div> 
            <div class="form-group full">
              <button type="submit" name="dosubmit" id="dosubmit" class="form-submit">提交</button>
              <button type="reset" class="form-submit">重置</button>
            </div>
          </form>

带姓名、手机、邮箱、公司名称、留言内容等js验证代码如下:

   <script type="text/javascript" language="javascript">
            function check(){
            nam=document.getElementById("name").value;
            if(nam==""){
            alert("请输入您的姓名!")
            return false;
            }
            re = /^1[3|4|5|6|7|8|9]\d{9}$/
            tel=document.getElementById("mobile").value;
            if (re.test(tel)) { 
                } else {
                    alert("请输入正确的手机号!");
            return false;
            }
   em = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
   eml=document.getElementById("email").value;
   if(em.test(eml)){ 
    }else{
     alert("请输入正确的邮箱!");
   return false;
   }
            gs=document.getElementById("gsmc").value;
            if(gs==""){
            alert("请输入公司名称!")
            return false;
            }
            nr=document.getElementById("neirong").value;
            if(nr==""){
            alert("请输入留言内容!")
            return false;
            }
            }
            </script>


赞一下
--
踩一脚
--

您已成功复制微信号

leishi010

打开微信添加好友?

确定