用到的插件

jquery.js

jquery.form.js[http://malsup.github.io/jquery.form.js]

提交页面

        <form enctype="multipart/form-data" >
            <div class="cls">
                <label for="mail">
                <span class="require">*</span>电子邮箱</label>
                <input type="text" >
            </div>
            <div class="cls">
                <label for="qq">QQ号</label>
                <input type="text" >
            </div>
            <div class="cls">
                <label for="tel">联系电话</label>
                <input type="text" >
            </div>
            <div class="cls">
                <label for="question">
                    <span class="require">*</span>问题描述</label>
                <textarea name="question" ></textarea>
            </div>
            <div class="cls">
                <label for="file">添加附件</label>
                <input type="file" name="file" >
            </div>
            <div class="checkcode cls">
                <label for="code">验证码</label>
                <input type="text" >
                <?php
                $this->widget('CommonUrlCaptcha',array(
                    'showRefreshButton'=>true,
                    'clickableImage'=>true,
                    'buttonLabel'=>'换一张',
                    'imageOptions'=>array(
                        'alt'=>'点击换图',
                        'title'=>'点击换图',
                        'id' => 'img_captcha',
                        'style'=>'cursor:pointer',
                        'backColor'=>'#000',
                        'width' => 80, 
                        'height' => 30, 
                    )
                ));
                ?>
            </div>
            <div class="cls">
                <label for=""></label>
                <input type="button" value="提交" class="btn-guest" >
            </div>
        </form>

js

<script type="text/javascript" charset="utf-8" src="/js/chat_version2/jquery.form.js"></script>
<script type="text/javascript" charset="utf-8">
  $(document).ready(function(){
      var options={
          url:"onlineService/OnlineServiceLeaveMessage",
              type:"post",
              success:function(mes){
                  alert(mes);
              }
      };
      $("#onlineservice_leave_message_form").submit(function() {
          $(this).ajaxSubmit(options);
          return false;
      });

      $("#onlineservice_leave_message_submit").click(function(){
          $("#onlineservice_leave_message_form").submit();
      });
  });
</script>

 

 

jquery.form.js 主要方法说明, 参考

http://www.open-open.com/lib/view/open1325032463827.html

相关文章:

  • 2021-09-12
  • 2022-02-08
  • 2021-10-15
  • 2021-08-14
  • 2022-12-23
  • 2021-05-20
  • 2021-11-29
猜你喜欢
  • 2022-02-08
  • 2021-09-30
  • 2022-12-23
  • 2022-01-14
  • 2021-08-14
  • 2022-02-26
  • 2022-12-23
相关资源
相似解决方案