1.表单字段重复校验方法
<input name="departname" class="inputxt" value="${depart.departname }" validType="t_s_depart,departname,id" datatype="s3-10">
2.数据字典取值
<t:dictSelect field="fjingji" hasLabel="false" typeGroupCode="fjingji" defaultVal="${paichePage.fjingji}"></t:dictSelect>
typeGroupCode:数据字典的名字
3.数据表里取值
<t:dictSelect field="createBy" dictTable="t_s_base_user" dictCondition="where departid='2c92b1f26778a02d01677bde33cf0192'" dictField="username" dictText="username" title="下派状态">
</t:dictSelect>
dictTable:表名 dictCondition:表的描述 dictField:表的字段(传给后台的值) dictText:界面显示的字段
取值:
$("select[name='createBy']").val();
$("select[name='createBy']").find("option:selected").text();
4.c:if标签
<c:if test="${ ldcOrderPage.orderPcname != '进口空运'&&ldcOrderPage.orderPcname != '进口一体化空运'}">
5.c:foreach标签
<c:forEach items="${decLists}" var="poVal" varStatus="stuts">
其中stuts.index为序号,poVal为实体类对象,取值如poVal.createName
6.验证
非空验证
<input type="text" name="demotitle" id="demotitle" datatype="*" errormsg="该字段不为空">
url验证
<input type="text" name="demourl" id="demourl" datatype="url" errormsg="必须是URL">
邮箱验证
<input type="text" name="demoorder" id="demoorder" datatype="e" errormsg="邮箱非法">
手机号
<input type="text" name="phone" id="phone" datatype="m" errormsg="手机号非法">
金额
<input type="text" name="money" id="money" datatype="d" errormsg="金额非法">
7.选择标签
<td class="value"> <input id="roleid" name="roleid" type="text" value="" /> <input name="roleName" class="inputxt" value="" id="roleName" readonly="readonly" datatype="*" /> <t:choose hiddenName="roleid" hiddenid="id" url="userController.do?roles" name="roleList" icon="icon-search" title="选择操作标签" textname="roleName" isclear="true" isInit="true"></t:choose> <span class="Validform_checktip"></span> </td> 复制代码
8.select2标签
引入的文件
<link rel="stylesheet" href="plug-in/select2/css/select2.min.css"> <script type="text/javascript" src="plug-in/select2/js/select2.full.min.js"></script>
页面代码
<td style="90px;text-align: right;">省份选择:</td> <td> <input type="text" id="province-select" name="province-select" class="ac_input"> </td>
js方法
$(function() { var select2Data = new Array(); $.ajax({ url:'jeecgFormDemoController.do?regionSelect&pid=1', type:'GET', dataType:'JSON', delay: 250, cache: true, success: function(data){ for(var i = 0; i < data.length; i++){ var select2Obj = {}; select2Obj.id = data[i].id; select2Obj.text = data[i].name; select2Data.push(select2Obj); } $("#province-select").select2({ data: select2Data, placeholder:'请选择省份',//默认文字提示 language: "zh-CN",//汉化 allowClear: true//允许清空 }); } }) }) ;