01.code/LanweiUI/lib.1.3.3/Source/demos/form/v125/fieldError.htm
(完整代码) 2KB<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><title>
</title>
<link href="../../../lib/ligerUI/skins/Aqua/css/ligerui-all.css" rel="stylesheet" type="text/css" />
<link href="../../../lib/ligerUI/skins/Gray/css/all.css" rel="stylesheet" type="text/css" />
<script src="../../../lib/jquery/jquery-1.9.0.min.js" type="text/javascript"></script>
<script src="../../../lib/ligerUI/js/ligerui.all.js"></script>
<script src="../../grid/CustomersData.js"></script>
<script type="text/javascript">
var groupicon = "../../../lib/ligerUI/skins/icons/communication.gif";
var form = null;
$(function ()
{
//创建表单结构
form = $("#form2").ligerForm({
inputWidth: 170, labelWidth: 90, space: 40,
fields: [
{ display: "折扣", name: "QuantityPerUnit", newline: true, type: "number", editor: { onChangeValue: sum } },
{
display: "单价", name: "UnitPrice", newline: false, type: "number", editor: { onChangeValue: sum }
},
{
display: "结算", name: "RealPrice", newline: true, type: "digits", groupicon: groupicon
}
]
});
});
function sum()
{
var data = form.getData();
$("[name=RealPrice]").val(data.QuantityPerUnit * data.UnitPrice / 100);
}
function c1()
{
form.showFieldError("RealPrice", "计算不正确!");
}
function c2()
{
form.hideFieldError("RealPrice");
}
</script>
<style type="text/css">
.liger-button {
float:left;margin-left:10px;
}
</style>
</head>
<body style="padding:10px">
<div id="form2"></div>
<div class="liger-button" data-click="c1">显示错误</div>
<div class="liger-button" data-click="c2" data-width="100">隐藏错误</div>
</html>
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读 AI
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
