<!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[MobileBrand][brand_name]' : {
				'required' : true,
				'remote' : {
					url:'./index.php',
					cache:false,
					data:{
						r:'MobileSet.checkbrand',
						brandName:function(){
							return $("#MobileBrand_brand_name").val();
						},
						brandId:function(){
							return $("#MobileBrand_id").val();
						}
					}
				}
			},
			'data[MobileBrand][show_order]' : {
				'required' : true,
				'digits' : true,
				'range' : [1,999]
			}
		},
		messages: {
			'data[MobileBrand][brand_name]' : {
				'required' : '手机品牌不能为空',
				'remote' : jQuery.format('手机品牌{0}已存在，请重新输入')
			},
			'data[MobileBrand][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.editbrand" method="post" id="editForm">
<input type="hidden" name="data[MobileBrand][id]" id="MobileBrand_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[MobileBrand][brand_name]" value="<!--{$data.brand_name}-->" id="MobileBrand_brand_name" class="text" maxlength='30'/><span id="span_MobileBrand_brand_name"></span></td>
	</tr>
	<tr>
		<td class="td_name">排列顺序<span class="red">*</span></td>
		<td class="td_content"><input type="text" name="data[MobileBrand][show_order]" value="<!--{$data.show_order}-->" id="MobileBrand_show_order" class="text" maxlength='3'/><span id="span_MobileBrand_show_order"></span></td>
	</tr>
	<tr>
		<td class="td_name">是否热门品牌</td>
		<td class="td_content">
		<!--{if $data.hot_flag == 1}-->
		是&nbsp;<input type="radio" name="data[MobileBrand][hot_flag]" id="MobileBrand_hot_flag" value="1" checked="checked"/>&nbsp;&nbsp;&nbsp;否&nbsp;<input type="radio" name="data[MobileBrand][hot_flag]" id="MobileBrand_hot_flag" value="0"/>
		<!--{else}-->
		是&nbsp;<input type="radio" name="data[MobileBrand][hot_flag]" id="MobileBrand_hot_flag" value="1" />&nbsp;&nbsp;&nbsp;否&nbsp;<input type="radio" name="data[MobileBrand][hot_flag]" id="MobileBrand_hot_flag" value="0" checked="checked"/>
		<!--{/if}-->
		</td>
	</tr>
	<tr>
		<td class="noborder"></td>
		<td class="noborder"><button type="submit" class="butsubmit">修改</button></td>
	</tr>
</table>
</form>
</body>
</html>