43 lines
1.3 KiB
Plaintext
43 lines
1.3 KiB
Plaintext
|
|
<%@ page contentType="text/html;charset=UTF-8"%>
|
||
|
|
<div id="auDiv" class="hide">
|
||
|
|
<form id="auForm" method="POST" onsubmit="return false;">
|
||
|
|
<table cellspacing="0" cellpadding="0" border="0" class="customTable">
|
||
|
|
<tbody>
|
||
|
|
<tr style="display: none">
|
||
|
|
<td colspan="2" class="ui-state-error"><input type="hidden" name="examId"></input></td>
|
||
|
|
<td colspan="2" class="ui-state-error"><input type="hidden" name="userId"></input></td>
|
||
|
|
</tr>
|
||
|
|
<tr class="FormData">
|
||
|
|
<td class="CaptionTD">成绩:</td>
|
||
|
|
<td class="DataTD">
|
||
|
|
<input type="text" style="width: 80%;" name="grade" class="FormElement ui-widget-content ui-corner-all"
|
||
|
|
jyValidate="required" onblur="checkNum(this)"></input>
|
||
|
|
</td>
|
||
|
|
</tr>
|
||
|
|
</tbody>
|
||
|
|
</table>
|
||
|
|
</form>
|
||
|
|
</div>
|
||
|
|
<script type="text/javascript">
|
||
|
|
function checkNum(that) {
|
||
|
|
var num = $(that).val();
|
||
|
|
if(isNumber(num) == false) {
|
||
|
|
var html = "<h4 style='color:red;'>请输入合法数字</h4>";
|
||
|
|
var idcardMsg = layer.confirm(html, {btn: ['关闭']},function(){
|
||
|
|
layer.close(idcardMsg);
|
||
|
|
$(that).val("");
|
||
|
|
$(that).focus();
|
||
|
|
});
|
||
|
|
}
|
||
|
|
}
|
||
|
|
//验证是否为数字
|
||
|
|
function isNumber(value) {
|
||
|
|
var patrn = /^(-)?\d+(\.\d+)?$/;
|
||
|
|
if (patrn.exec(value) == null || value == "") {
|
||
|
|
return false;
|
||
|
|
} else {
|
||
|
|
return true;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
</script>
|