onLoadSuccess: function (db) {
//db是后台数据的返回结果集
$.ajax({
url: "AjaxSource/Buex.ashx",
data: { "OPT": "tjsz", "ID"},
success: function (s) {
//当前页收入及支出
var inmony = [];
var outmony = [];
for (var i = 0; i < db.rows.length; i++) {
var ind = db.rows[i].InMoney == '' ? 0 : db.rows[i].InMoney;
var outd = db.rows[i].OutMoney == '' ? 0 : db.rows[i].OutMoney;
inmony.push(ind);
outmony.push(outd);
}
var tinmony = eval(inmony.join('+'));
var toutmony = eval(outmony.join('+'));
var mony = " 当页收入:" + tinmony.toFixed(2) + " 当页支出:" + toutmony.toFixed(2);//保留两位小数
var df = s + " " + mony;
var pager = $('#datas').datagrid("getPager");
if (pager) {
$(pager).pagination({
butTxt: df
});
}
}
//js easyui dategrid 行里面
if (v == "") {
//传递多个参数
return '<div ><a href="javascript:void(0)" onclick="Cancel(' + '\'' + r.ID + '\',\'' + r.SZType + '\',\'' + r.ChildComUU + '\',\'' + money + '\',\'' + r.Ty + '\'' + ')" style="cursor:hand;color:purple"></a></div>';
}
//创建新窗体
function uplad(id) {
parent.OpenWindow("CWd.aspx?tp=uubank&cdid=" + id, "证", "", 400, 80);
}
//js安全验证码
$(function () {
/*验证安全码*/
$('#txttwopw').keyup(function () {
var paypw = $.trim($('#txttwopw').val());
if (paypw.length > 0) {
$('#txttwopw').css("background-color", "#E9E9E4");
$.ajax({ type: "POST", url: "AjaxSource/CWCDayListNewMimaSet.ashx",
data: "PayPw=" + encodeURI(encodeURI(paypw)),
success: function (msg) {
if (msg == "1") {
document.getElementById('yanzhen').innerHTML = "匹配";
document.getElementById('hidrole').value = "匹配";
} else { document.getElementById('yanzhen').innerHTML = "不匹配"; document.getElementById('hidrole').value = "1"; }
}
});
}
else {
document.getElementById('yanzhen').innerHTML = " ";
document.getElementById('hidrole').value = "1";
$('#txttwopw').css("background-color", "");
}
}); }) /*点击确定判断*/
function Panduan() {
if ($('#hidrole').val() != "匹配") {
alert("安全码不正确!");
return false;
}
}
js验证
aspx页面
<tr>
<td>
安全密码:
</td>
<td>
<input id="txttwopw" type="password" style="width: 100px;" />
<input type="hidden" name="hidrole" id="hidrole" />
<span id="yanzhen" style="color:Red;"></span>
</td>
</tr>
table
<input type="submit" name="OK" value=" 同意" onclick="return Panduan();" id="OK" />