天天看點

jquery-esayui的input框常用屬性

<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':'' }/>關