Blogger Information
Blog 5
fans 0
comment 2
visits 23799
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
layui获取下拉框选中的值
郑小飒的博客
Original
12716 people have browsed it

layui获取下拉框选中的值

Posted on 2018年8月23日 By 618插件网

添加新的窗口<div class="citymd">
   <ul>
       <li>
           <a onclick="openCityTab('/pc/plugin/pdf-js/web/viewer.html?name=${base}/pc/pdf_report/stateProfile_pdf/AmericaSurveyAnalysis.pdf','美国')">美国</a>
       </li>
   </ul></div>
var base = "${base}";
function openCityTab(url, title) {
 top.larryTab.tabAdd({
   title: title,
   href: url
 });
}
<form class="layui-form" action="">
   <div class="layui-form-item layui-col-md3  ">
       <label class="layui-form-label">请选择</label>
       <div class="layui-input-block">
           <select class="form-control input-sm" name="category" lay-filter="category" aria-invalid="false">
               <option value="0">中国</option>
               <option value="1">美国</option>
               <option value="2">德国</option>
               <option value="3">***</option>
               <option value="4">中美德日</option>
           </select>
       </div>
   </div>
</form>
 layui.use('form', function () {    var form = layui.form;    var category = 0;    var categoryName = '';
   form.on('select(category)', function (data) {
     category = data.value;
     categoryName = data.elem[data.elem.selectedIndex].text;
     form.render('select');
   });
 });


Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post