<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<script>
$().ready(function(){
	$("#updateForm").validate({
		rules: {
			"data[MusicFile][download_url]" : {
				"required":true
			},
			"data[MusicFile][file_size]" : {
				'digits' : true
			}
		},
		messages: {
			"data[MusicFile][download_url]" : {
				"required":"下载地址不能为空"
			},
			"data[MusicFile][file_size]" : {
				"digits":"文件大小必须为整数"
			}
		},
		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>
<form id="updateForm" action="index.php?r=Music.editmusicfile" method="post">
	<input type="hidden" name="returnParams" value="<!--{$filelistReturnParams}-->"/>
	<input type="hidden" name="data[MusicFile][id]" value="<!--{$data.id}-->"/>
	<input type="hidden" name="data[MusicFile][music_id]" value="<!--{$data.music_id}-->"/>
	<table class="tbl_edit" width="100%">
		<tr>
			<td class="td_name">说明</td>
			<td class="td_content"><input type="text" class="text" name="data[MusicFile][introduction]" value="<!--{$data.introduction}-->"/></td>
		</tr>
		<!--{if $data.download_type eq 2}-->
		<tr>
			<td class="td_name">歌曲下载地址<span class="red">*</span></td>
			<td class="td_content"><input type="text" class="text required" id="download_url" name="data[MusicFile][download_url]" value="<!--{$data.download_url}-->"/><span id="span_download_url"></span></td>
		</tr>
		<tr>
			<td class="td_name">歌词下载地址</td>
			<td class="td_content"><input type="text" class="text" id="lyric_down_url" name="data[MusicFile][lyric_down_url]" value="<!--{$data.lyric_down_url}-->"/></td>
		</tr>
		<tr>
			<td class="td_name">文件类型</td>
			<td class="td_content"><input type="text" class="text" id="file_type" name="data[MusicFile][file_type]" value="<!--{$data.file_type}-->"/></td>
		</tr>
		<tr>
			<td class="td_name">文件大小</td>
			<td class="td_content"><input type="text" class="text" id="file_size" name="data[MusicFile][file_size]" value="<!--{$data.file_size}-->"/><span id="span_file_size"></span></td>
		</tr>
		<!--{else}-->
		<tr>
			<td class="td_name">歌曲下载地址</td>
			<td class="td_content"><!--{$data.download_url}--></td>
		</tr>
		<tr>
			<td class="td_name">歌词下载地址</td>
			<td class="td_content"><!--{$data.lyric_down_url}--></td>
		</tr>
		<tr>
			<td class="td_name">文件类型</td>
			<td class="td_content"><!--{$data.file_type}--></td>
		</tr>
		<tr>
			<td class="td_name">文件大小</td>
			<td class="td_content"><!--{$data.file_size}-->K</td>
		</tr>
		<!--{/if}-->
		<tr>
			<td class="noborder"></td>
			<td class="noborder"><button type="submit" class="butsubmit">提交</button></td>
		</tr>
	</table>
</form>