1、输入框样式
class="mini-textbox" //普通输入框
class="mini-password" //密码输入框
class="mini-textarea" //文本输入框
lass="mini-datepicker" //日期选择(value="2010-10-12")
class="mini-spinner" //数字框(value="22" minValue="10" maxValue="50")
class="mini-timespinner" //时间微调(format="H:mm")
class="mini-checkbox" //选择框(value="Y" trueValue="Y" falseValue="N")
class="mini-combobox" //下拉选择框(showNullItem="true" url="../data/countrys.txt" textField="text" valueField="id" value="cn")
class="mini-treeselect" //树选择框(url="../data/listTree.txt" multiSelect="true" textField="text" valueField="id" parentField="pid" checkRecursive="true"
value="ajax")
class="mini-checkboxlist" //复选框(repeatItems="3" repeatLayout="flow" url="../data/countrys.txt" value="cn,de,usa" textField="text" valueField="id")
class="mini-radiobuttonlist" //单选框(value="en" repeatItems="4" repeatDirection="vertical" repeatLayout="table" url="../data/countrys.txt"
textField="text" valueField="id")
class="mini-listbox" //展开的选择框(url="../data/countrys.txt" value="fr" textField="text" valueField="id" style="height:120px;")
2、输入内容限制
required="true" //不允许为空 requiredErrorText="帐号不能为空" minLengthErrorText="密码不能少于5个字符" onvalidation="onUserNameValidation" //输入框验证,添加事件function onUserNameValidation(e){},输入后自动出发 vtype="email" //必须是邮箱地址 vtype="url" //必须是URL vtype="int" //必须是整数(int) vtype="float" //必须是数字(float) vtype="maxLength:6" //字符串长度(<= 6) vtype="minLength:2" //字符串长度(>= 2) vtype="rangeLength:2,6" //字符串长度(2-6) vtype="rangeChar:2,6" //字符数个数(2-6) vtype="range:0,100" //数字范围(0-100) vtype="date:yyyy-MM-dd" //必须是日期格式(如yyyy-MM-dd) vtype="date:MM/dd/yyyy" //必须是日期格式(如MM/dd/yyyy) vtype="email;rangeLength:5,20;" //邮箱格式,5~20个字符(组合) onvalidation="onEnglishValidation" //必须输入英文(自定义) vtype="english" //必须输入英文(自定义vtype) onvalidation="onEnglishAndNumberValidation" //必须输入英文+数字(自定义) onvalidation="onChineseValidation" //必须输入中文(自定义) onvalidation="onIDCardsValidation" //身份证验证15~18位(自定义)
3、表单操作
class="mini-datagrid"
if (form.isValid() == false) return;
var form = new mini.Form("#form1");
var data = form.getData(); //获取表单多个控件的数据
form.setData(data); //设置控件数据
form.unmask();
form.clear(); //清除表单
form.reset(); //重置表单