<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head><title><!--{$UUDEV_PAGE_TITLE}--></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript">
$().ready(function(){
	$("#editForm").validate({
		rules: {
			'data[MobileScreen][screen_size]' : {
				'required' : true,
				'remote' : {
					url:'./index.php',
					cache:false,
					data:{
						r:'MobileSet.checkscreen',
						screenSize:function(){
							return $("#MobileScreen_screen_size").val();
						},
						screenId:function(){
							return $("#MobileScreen_id").val();
						}
					}
				}
			},
			'data[MobileScreen][show_order]' : {
				'required' : true,
				'digits' : true,
				'range' : [1,999]
			}
		},
		messages: {
			'data[MobileScreen][screen_size]' : {
				'required' : '屏幕大小不能为空',
				'remote' : jQuery.format('屏幕大小{0}已存在，请重新输入')
			},
			'data[MobileScreen][show_order]' : {
				'required' : '排列顺序不能为空',
				'digits' : '排列顺序必须为整数',
				'range' : '排列顺序必须在1-999之间'
			}
		},
		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");
		}
	});
});
</script>
</head>
<body>
<form action="index.php?r=MobileSet.editscreen" method="post" id="editForm">
		<input type="hidden" name="data[MobileScreen][id]" id="MobileScreen_id" value="<!--{$data.id}-->">
		<input type="hidden" name="returnParams" value="<!--{$returnParams}-->">
		<table class="tbl_edit" width="100%"><tr>
			<td class="td_name">屏幕大小<span class="red">*</span></td>
			<td class="td_content">
			<input type="text" name="data[MobileScreen][screen_size]" value="<!--{$data.screen_size}-->" id="MobileScreen_screen_size" class="text" maxlength='30'/><span id="span_MobileScreen_screen_size"></span>
			</td>
		</tr><tr>
			<td class="td_name">排列顺序<span class="red">*</span></td>
			<td class="td_content">
				<input type="text" name="data[MobileScreen][show_order]" id="MobileScreen_show_order" class="text" value="<!--{$data.show_order}-->" maxlength='3'/><span id="span_MobileScreen_show_order"></span>
			</td>
		</tr>
		<tr>
		<td class="noborder"></td>
		<td class="noborder"><button type="submit" class="butsubmit">提交</button></td>
		</tr></table>
</form>
</body>
</html>