css控制字符过长显示问题
<style type="text/css">
.demo {display: inline-block;
*display: inline;
*zoom: 1;
width: 140px;
height: 20px;
line-height: 20px;
font-size: 12px;
overflow: hidden;
-ms-text-overflow: ellipsis;
text-overflow: ellipsis;
white-space: nowrap;}
.demo:hover {height: auto;white-space: normal;}
.hiddenword {display: inline-block;*display: inline;*zoom: 1;width: 140px;line-height: 20px;font-size: 12px;overflow: hidden;-ms-text-overflow: ellipsis;text-overflow: ellipsis;white-space: nowrap;}
}
</style>
el表达式控制字符长度问题:
<td nowrap style="text-align:center;" title="${item.WORK_CONTENT}">
<c:if test="${fn:length(item.WORK_CONTENT) > 10}">
${fn:substring(item.WORK_CONTENT, 0, 10)}...
</c:if>
<c:if test="${fn:length(item.WORK_CONTENT) <= 10}">
${item.WORK_CONTENT}
</c:if>
</td>
class="pageForm required-validate" class="required" 不为空验证
根据两个表的数据更新其中一个表
update hr_employee h
set h.promotion_day = (select a.c from aa a where a.a = h.empid)
where h.cpny_id = '1200'
and exists (select 1 from aa a where h.empid = a.a)
验证输入信息为整数 且不以00开头
//整数^-?\d+$ 非负整数^([1-9]\d{0,9}|0)$
function onEnter(obj,index){
var reg = /^-?\d+$/;
var s = $(obj).val();
var t = parseInt(s);$(obj).val(t);
if(s.length>5){$(obj).val("0"); alertMsg.info("超出最大输入人数!")}
if(t==0){$(obj).val("0")};
if( !reg.test(s)){$(obj).val("0");}
}
jsp代码 onchange="onEnter(this,${i.index});"
//实时校验IE9以上// Firefox, Google Chrome, Opera, Safari, Internet Explorer from version 9
$("#WAGE_LEVEL").bind('input propertychange',function(){
var reg = /^([^0]|[0-9]+|0)$/;
var s = $(this).val();
var t = parseInt(s);$(this).val(t);
if('NaN'==t){$(this).val("0");};
if(s.length>7){$(this).val("0"); alertMsg.info("超出最大输入数值!")}
if(t==0){$(this).val("0")};
if( !reg.test(s)){$(this).val("0");}
})
jsp代码 <input type="text" id="WAGE_LEVEL" name="WAGE_LEVEL" value="${WAGE_LEVEL}" size=40/>
$("input[class='anytime']").bind('input propertychange',function(){
var id= $(this).attr("id");
var lists = id.split("_");
suGrade();sumPlanEmp(lists[2]);
var reg = /^([^0][0-9]+|0)$/;
var s = $(this).val();
var t = parseInt(s);$(this).val(t);
if(s.length>5){$(this).val("0"); alertMsg.info("超出最大输入人数!")}
if(t==0){$(this).val("0")};
if( !reg.test(s)){$(this).val("0");}
});
下拉取多个值
html代码:
<td>课程名称</td>
<td>
<select id="COURSEID" name="COURSE_NAME_CODE">
<option value="">请选择</option>
<c:forEach items="${courseManagerList}" var="c" varStatus="i">
<c:if test="${c.ACTIVITY eq '1'}">
<option value="${c.COURSE_NO}" periods="${c.COURSE_PERIODS}"<c:if
test="${c.COURSE_NO eq COURSE_NO}">selected="selected"</c:if>>${c.COURSE_NAME_CODE}-${c.COURSE_PERIODS}期</option>
</c:if>
</c:forEach>
</select>
</td>
js取值:
var periods = parseInt($('#COURSEID option:selected').attr('periods'));