<!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(){
	$("#singerForm").validate({
		rules: {
			"data[MusicSinger][singer_name]" : "required",
			"data[MusicSinger][first_character]" : "required",
			"data[MusicSinger][singer_area_id]" : "required"
		},
		messages: {
			"data[MusicSinger][singer_name]" : "歌手姓名不能为空",
			"data[MusicSinger][first_character]" : "歌手首字母不能为空",
			"data[MusicSinger][singer_area_id]" : "地区不能为空"
		},
		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");
		}
	});

	$("#slc_singer_area_id").change(function(){
		$("#singer_area").val($("#slc_singer_area_id option:selected").html());
	});
})
</script>
</head>
<body>
<form id="singerForm" action="index.php?r=Music.editsinger" method="post">
	<input type="hidden" name="returnParams" value="<!--{$returnParams}-->"/>
	<input type="hidden" name="data[MusicSinger][id]" id="singer_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="singer_name" name="data[MusicSinger][singer_name]" value="<!--{$data.singer_name}-->" maxlength="32"/><span id="span_singer_name"></span></td>
		</tr><tr>
		<td class="td_name">歌手首字母<span class="red">*</span></td>
		<td class="td_content"><input type="text" class="text" maxlength="1" id="first_character" name="data[MusicSinger][first_character]" value="<!--{$data.first_character}-->" maxlength="1"/><span id="span_first_character"></span></td>
		</tr><tr>
		<td class="td_name">地区<span class="red">*</span></td>
		<td class="td_content"><select id="slc_singer_area_id" name="data[MusicSinger][singer_area_id]">
				<option value="">请选择地区</option>
				<!--{foreach from=$area item=item}-->
					<!--{if $data.singer_area_id == $item.id}-->
						<option value="<!--{$item.id}-->" selected="selected"><!--{$item.area}--></option>
					<!--{else}-->
						<option value="<!--{$item.id}-->"><!--{$item.area}--></option>
					<!--{/if}-->
				<!--{/foreach}-->
			</select><span id="span_slc_singer_area_id"></span>
			<input type="hidden" id="singer_area" name="data[MusicSinger][singer_area]" value="<!--{$data.singer_area}-->"/>
		</td>
		</tr><tr>
		<td class="td_name">类型<span class="red">*</span></td>
		<td class="td_content">
			<select id="singer_type" name="data[MusicSinger][singer_type]">
				<option value="1" <!--{if $data.singer_type == 1}-->selected="selected"<!--{/if}-->>男歌手</option>
				<option value="2" <!--{if $data.singer_type == 2}-->selected="selected"<!--{/if}-->>女歌手</option>
				<option value="3" <!--{if $data.singer_type == 3}-->selected="selected"<!--{/if}-->>组合</option>
			</select>
		</td>
		</tr><tr>
		<td class="noborder"></td>
		<td class="noborder"><button type="submit" class="butsubmit">提交</button></td></tr>
	</table>
</form>
</body>
</html>