<extend name="Public/base"/>
<block name="content">
   
  <div class="container w-480 p-n">
   <!--  <div class="nav-hand">

      <span class="ch">问答锦集</span>
    </div> -->
    <!-- content -->
    <div class="container-fluid p-l-20 p-r-20 m-t-20">
           <div class="panel form-panel">
              <div class="panel-heading">
                <span class="ch">请在这里给我们留言，我们会尽快给您回复</span>
              </div>
              <div class="panel-body">
                <div class="row leave-container">
                <form class="form-horizontal" action="{:U('Messages/add')}" method="post" class="ajax-post">
                  <div class="form-group">
                    <label for="input-name" class="col-sm-2 control-label"><span class="text-danger" >*</span>姓名:</label>
                    <div class="col-sm-10">
                      <input type="text" class="form-control" name="name" value="" placeholder="姓名" data-validate="required:姓名必填">
                    </div>
                  </div>
                  <div class="form-group">
                    <label for="input-name" class="col-sm-2 control-label"><!-- <span class="text-danger">*</span> -->电话:</label>
                    <div class="col-sm-10">
                      <input type="text" class="form-control" name="phone" value="" placeholder="电话" data-validate="required:电话必填,tel:电话格式错误">
                    </div>
                  </div>
                 
                 
                  <div class="form-group">
                    <label for="input-name" class="col-sm-2 control-label"><span class="text-danger">*</span>内容:</label>
                    <div class="col-sm-10">
                      <textarea rows="3" class="form-control" placeholder="留言" name="content" data-validate="required:内容必填"></textarea>
                    </div>
                  </div>
                  <div class="form-group">
                    <label for="input-name" class="col-sm-2 control-label"><span class="text-danger">*</span>验证码:</label>
                    <div class="col-sm-10">
                      <input type="text" class="form-control fl" name="verify" value="" placeholder="验证码" style="width:30%"><img src="{:U('Messages/verify')}" width="128" height="35" class="fl" alt="看不清刷新" id="de"  onclick="reloadcode()">
                    </div>
                  </div>
                  <div class="form-group">
                    <div class="col-sm-offset-2 col-sm-10">
                      <button type="submit" id="submit" class="btn btn-default">提交</button>
                      <button type="reset" class="btn btn-default">清除</button>
                    </div>
                  </div>
                </form>
                </div>
              </div>
           </div>

           

    </div>
    <!-- //content -->

  </div>
  <!-- //主体 -->
<script>
function reloadcode(){
var verify=document.getElementById('de');
verify.setAttribute('src','{:U('Messages/verify')}?'+Math.random());
}
$(function(){
$('#submit').xbValidform();
});
</script>
</block>