<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<!--{include file=elements/header.css.html}-->
<!--{include file=elements/header.js.html type=common}-->
<!--{include file=elements/header.js.html type=popbox}-->
<!--{include file=elements/header.js.html type=valid}-->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script>
$().ready(function(){
	$("#adForm").validate({
		rules: {
			"data[Ad][ad_name]" : "required",
			"data[Ad][ad_language]" : "required",
			"data[Ad][ad_url]" : "required"
		},
		messages: {
			"data[Ad][ad_name]" : "请输入广告名称",
			"data[Ad][ad_language]" : "请输入广告语",
			"data[Ad][ad_url]" : "请输入广告链接"
		},
		errorPlacement: function(error, element){
			$("#span_" + element.attr("id")).html(error).attr("class", "error");
		},
		submitHandler: function(form){
			setDisabled(":button",window.document);
			form.submit();
		},
		errorClass: "invalid",
		success: function(label){
			label.parent().html("&nbsp;").attr("class", "valid");
		},
		onkeyup: false
	});
});
</script>
</head>
<body>
	<form id="adForm" action="index.php?r=Ad.update" method="post">
		<input type="hidden" name="data[Ad][id]" value="<!--{$data.id}-->"/>
		<input type="hidden" name="returnParams" value="<!--{$data.returnParams}-->"/>
		<table class="tbl_edit" width="100%">
			<tr>
				<td class="td_name">广告名称<span style="color:red;">*</span></td>
				<td class="td_content"><input type="text" class="text" id="ad_name" name="data[Ad][ad_name]" value="<!--{$data.ad_name}-->" maxlength="128"/><span id="span_ad_name"></span></td>
			</tr>
			<tr>
				<td class="td_name">广告语(用 | 分割)<span style="color:red;">*</span></td>
				<td class="td_content"><input type="text" class="text" id="ad_language" name="data[Ad][ad_language]" value="<!--{$data.ad_language}-->" maxlength="512"/><span id="span_ad_language"></span></td>
			</tr>
			<tr>
				<td class="td_name">广告链接<span style="color:red;">*</span></td>
				<td class="td_content"><input type="text" class="text" id="ad_url" name="data[Ad][ad_url]" value="<!--{$data.ad_url}-->"/><span id="span_ad_url" maxlength="512"></span></td>
			</tr>
			<tr>
				<td class="td_name">备注</td>
				<td class="td_content"><input type="text" class="text" name="data[Ad][memo]" value="<!--{$data.memo}-->" maxlength="1000"/></td>
			</tr>
			<tr>
				<td class="noborder"></td>
				<td class="noborder"><button type="submit" class="butsubmit">提交</button></td>
			</tr>
		</table>
	</form>
</body>
</html>