jquery-esayui的input框常用属性

本文介绍了一个使用EasyUI框架配置表单元素的具体示例,包括输入框的必填验证、数字输入限制、字符串长度限制及单选按钮的默认选中状态设置等关键配置。
<table class="tableForm">
    <tr>
     <td style="text-align:right;">手机号</td>
        <td colspan="2">
          <input type="text" name="phone"  class="easyui-numberbox" data-options="required:true"  maxlength="11"/>
        </td>
    </tr>
    <tr>
    </tr>
    <tr>
         <td style="text-align:right;">名称</td>
        <td colspan="3">
            <input  type="text"  name="name" class="easyui-validatebox" data-options="required:true" maxlength="15"/>
        </td>
    </tr>

    <tr>
        <td style="text-align:right;">日报开关</td>
        <td style="text-align:left">
            <span class="radioSpan">
                <input type="radio" name="sendSwitch" value="0" checked="checked"></input>
                <input type="radio" name="sendSwitch" value="1"></input>
            </span>
        </td>
    </tr>
    <tr>
        <td style="text-align:right;">计费开关</td>
        <td style="text-align:left">
            <span class="radioSpan">
                <input type="radio" name="chargingsendswitch" value="0" checked="checked"></input>
                <input type="radio" name="chargingsendswitch" value="1"></input>
            </span>
        </td>
    </tr>

</table>

不能为空:data-options=”required:true”
只能写数字:class=”easyui-numberbox”
什么都可以写:class=”easyui-validatebox”
限制内容长度:maxlength=”15”
刚进入页面单选按钮默认选中其中一个:

<input type="radio" name="sendSwitch" value="0" checked="checked">开</input>
<input type="radio" name="sendSwitch" value="1">关</input>

回显时值是什么就选中哪个:

<input type="radio"  name="sendSwitch" value="0" ${dailyList.sendSwitch=='0'?'checked':'' }/>开
<input type="radio"  name="sendSwitch" value="1" ${dailyList.sendSwitch=='1'?'checked':'' }/>关
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值