<!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>
$().ready(function(){
	$("#editForm").validate({
		rules: {
			"data[MusicSingerArea][area]" : {
				"required" : true,
				"remote" : {
					url : "index.php",
					cache : false,
					data : {
						r : "Music.checksingerarea",
						area : function(){
							return $("#area").val();
						},
						id : function(){
							return $("#area_id").val();
						}
					}
				}
			},
			"data[MusicSingerArea][show_order]" :{
				required: true,
				number: true,
				digits: true,
				range: [1, 999]
			}
		},
		messages: {
			"data[MusicSingerArea][area]" : {
				"required" : "地区不能为空",
				"remote" : "地区不能重复"
			},
			"data[MusicSingerArea][show_order]" :{
				required: "排序不能为空",
				number: "排序必须为正整数",
				digits: "排序必须为正整数",
				range: $.format("排序必须在{0}到{1}之间")
			}
		},
		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 id="editForm" action="index.php?r=Music.editsingerarea" method="post">
	<input type="hidden" name="returnParams" value="<!--{$returnParams}-->"/>
	<input type="hidden" name="data[MusicSingerArea][id]" id="area_id" value="<!--{$data.id}-->"/>
	<table class="tbl_edit" width="100%"><tr>
		<td class="td_name">地区<span class="red">*</span></td>
		<td class="td_content"><input type="text" class="text" id="area" name="data[MusicSingerArea][area]" value="<!--{$data.area}-->" maxlength="32"/><span id="span_area"></span></td>
		</tr><tr>
		<td class="td_name">排序<span class="red">*</span></td>
		<td class="td_content"><input type="text" class="text" id="show_order" name="data[MusicSingerArea][show_order]" value="<!--{$data.show_order}-->" maxlength="3"/><span id="span_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>