zoukankan      html  css  js  c++  java
  • 单选框

    1 <script type="text/html" id="radioTpl">
    2     <input type="radio" name="userRadio" value="{{d.userName}}" lay-filter="radiodemo">
    3 </script>
    1     form.on("radio(radiodemo)",function(obj) {
    2         console.log(obj);
    3         console.log(obj.value);
    4         $('#userRadio').val(this.value);
    5     });

     layui中的单选框反选:

    当没有选择的时候,value的值为空,则执行else;当选择了以后将选择的名字(唯一值)放到input单选框的value中,下次点击就可以选中

    1  templet: function (data) {
    2                         if (data.key == flowId) {
    3                             return '<input id="=radio_Id3" type="radio" checked name="selet1" value="' + data.key + '" lay-filter="radio" >';
    4                         } else {
    5                             return '<input id="=radio_Id3" type="radio"  name="selet1" value="' + data.key + '" lay-filter="radio" >';
    6                         }
  • 相关阅读:
    今日总结
    今日总结
    今日总结
    今日总结
    今日总结
    今日总结
    今日总结
    今日总结
    今日总结
    Interesting Finds: 2010 02.08 ~ 02.13
  • 原文地址:https://www.cnblogs.com/yangguoe/p/9257313.html
Copyright © 2011-2022 走看看