# 欄位限制(cshtml) ## 數字欄位(靠右) ### only-p-integer 正整數 ```htmlmixed= <input name="txtMONEY2" ng-model="searchData.ABANK_MONEY2" only-p-integer> ``` 只可以輸入正整數  --- ### only-integer 正、負整數 ```htmlmixed= <input name="txtMONEY2" ng-model="searchData.ABANK_MONEY2" only-integer> ``` 只可以輸入正、負整數  --- ### only-number 正負至小數點2位 ```htmlmixed= <input name="txtMONEY2" ng-model="searchData.ABANK_MONEY2" only-number> ``` 可以輸入正負數至小數點第二位  --- ### only-integer-str 數字字串 ```htmlmixed= <input name="txtMONEY2" ng-model="searchData.ABANK_MONEY2" only-integer-str> ``` --- ## 字串欄位(靠左) ### max-length 最大字數限制 ```htmlmixed= <input name="txtCODE"type="text" ng-model="editRow.ABANK_CODE" max-length="7"> ``` 限制輸入最大字數  --- ### isReadOnly 唯讀 ```htmlmixed= <input name="txtCODE" type="text" ng-disabled="isReadOnly('ABANK_CODE')"> ``` 限制欄位為唯讀  --- ### isRequired 必填(輸入框) ```isRequired <input name="txtCODE" type="text" ng-required="isRequired('DATE2')"> ``` 必須輸入(input)  --- ### isRequiredClass 必填(label) ```htmlmixed= <label for="txtID" class="control-label" ng-class="isRequiredClass('ABANK_CODE')"> ``` 必須輸入(label)  --- ## 日期欄位 ### only-date 日期 只可以輸入日期 ```htmlmixed= <input name="stxtDAY" class="form-control datepicker" only-date> ```  --- ### only-date-time 日期及時間 只可以輸入日期及時間 ```htmlmixed= <input name="stxtDAY" class="form-control datepicker" only-date-time> ```  --- ### datepicker 日期選擇 ```htmlmixed= <input name="stxtDAY" class="form-control datepicker"> ``` 選擇日期  ###### tags: `實習筆記`
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up