MENU

关闭

文档

表单提交及触发

加载系统配置的js 一般放到footer.html里面

<script type="text/javascript" src="*ADMIN*/js/form_ajax.js?v={:set('banben')}"></script>

上传文件

<!--示例1 -->
<div class="layui-col-md6">
    <div class="layui-form-item">
        <label class="layui-form-label">文件</label>
        <div class="layui-input-inline">
            <input type="text" name="name" id="fujian" value="" placeholder="上传" autocomplete="off" class="layui-input">
        </div>
        <div class="layui-form-mid layui-word-aux">
            <button type="button" class="layui-btn layui-btn-normal up" up="fujian">上传</button>
        </div>
    </div>
</div>
<!--示例2-->
<div class="layui-col-md6">
    <div class="layui-form-item">
        <label class="layui-form-label">图片</label>
        <div class="layui-input-inline">
            <input type="text" name="name" id="tupian" value="" placeholder="上传" autocomplete="off" class="layui-input">
        </div>
        <div class="layui-form-mid layui-word-aux">
            <button type="button" class="layui-btn layui-btn-normal upimg" up="tupian">上传</button>
        </div>
    </div>
</div>

表单提交

<form class="layui-form form" url="{:url('index/api/api')}" t_url="javascript:location.reload();">
  <div class="layui-form-item">
    <label class="layui-form-label">输入框</label>
    <div class="layui-input-block">
      <input type="text" name="title" required  lay-verify="required" placeholder="请输入标题" autocomplete="off" class="layui-input">
    </div>
  </div>
  <div class="layui-form-item">
    <div class="layui-input-block">
      <button class="layui-btn" lay-submit="" lay-filter="cms">立即提交</button>
    </div>
  </div>
</form>
<!--一个页面只能用一个表单 多个请看下面的变化  foum1  和foum2   cms1 和cms2 如果是一个页面只有一个表单随便用哪个都行-->
<form class="layui-form form1" url="表单提交的链接" t_url="提交后的返回地址">
  <div class="layui-form-item">
    <label class="layui-form-label">输入框</label>
    <div class="layui-input-block">
      <input type="text" name="title" required  lay-verify="required" placeholder="请输入标题" autocomplete="off" class="layui-input">
    </div>
  </div>
  <div class="layui-form-item">
    <div class="layui-input-block">
      <button class="layui-btn" lay-submit="" lay-filter="cms1">立即提交</button>
    </div>
  </div>
</form>
<!--示例二-->
<form class="layui-form form2" url="表单提交的链接" t_url="提交后的返回地址">
  <div class="layui-form-item">
    <label class="layui-form-label">输入框</label>
    <div class="layui-input-block">
      <input type="text" name="title" required  lay-verify="required" placeholder="请输入标题" autocomplete="off" class="layui-input">
    </div>
  </div>
  <div class="layui-form-item">
    <div class="layui-input-block">
      <button class="layui-btn" lay-submit="" lay-filter="cms2">立即提交</button>
    </div>
  </div>
</form>

触发链接 直接提交  提交后刷新页面

 class加上容器 del  然后加上url="触发的链接"
//例如
<a href="javascript:;" class="del"  url="触发的链接">示例</a>

触发链接 弹出提示 提交后刷新页面

class加上容器 del_t  然后加上url="触发的链接"  name="提示内容"  
//例如
<a href="javascript:;" class="del_t"  url="触发的链接" name="提示内容">示例</a>

用户充值

<a href="javascript:;" class="cz_user" >充值</a>

用户提现

<a href="javascript:;" class="tixian_user" >充值</a>

关于注册登录的发送验证码代码去默认模板查看路径/app/index/view/