Commit c566b699 authored by 高洋's avatar 高洋

Updates common-field-javascript.md

Auto commit by GitBook Editor
parent 5c417fc0
##字段级通用方法
*设置字段必填或者非必填属性Hel.setRequired(id,flag);
#### 设置字段必填属性
>Hel.setRequired(id,flag);
第一个参数id为字段的id,第二个参数flag为true时将该字段设为必填,为false时将该字段设为非必填。
```html
<h:hlsMaskedTextBox id="maskedTextBox"/>
<script><![CDATA[
Hel.setRequired('maskedTextBox',true);
]]></script>
```
\ No newline at end of file
```
####设置字段只读属性
>Hel.setReadonly(id,flag);
第一个参数id为字段的id,第二个参数flag为true时将该字段设为只读,为false时将该字段设为可输入。
```html
<h:hlsMaskedTextBox id="maskedTextBox"/>
<script><![CDATA[
Hel.setReadonly('maskedTextBox',true);
]]></script>
```
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment