easy-ui表单字段(单字段---》验证---》整数、小数 、%(同时需要))

// 单字段---》验证---》整数、小数  、%(同时需要)

<script>

//保底值
$.extend($.fn.validatebox.defaults.rules, {     //此句为自定义重写校验
bottom_value: {
validator: function (value) {
return /^d+(.d+)?$/i.test(value);
},
message: '请输入(整数,小数,百分率),并确保格式正确'
},
});

</script>

<body>

  <form id=“123” class ="form">

   <table>

    

<tr>
    <td class="right">
    <label for="bottom_value">保底值:</label>
</td>
<td class="left">
         <input type="text" id="bottom_value" name="bottom_value" style="200px;height:28px"
         class="easyui-validatebox" data-options="required:false,validType:'bottom_value'" />
</td>
</tr>

  </table>

</from>

</body>

原文地址:https://www.cnblogs.com/Darkqueen/p/9510931.html