<input type="hidden" name="id" value="<{$row.id}>"/>
<table class="etable">
	<tr>
		<td width="70">名称： </td>
		<td><input type="text" name="name" size="30" id="name" value="<{$row.name}>"/></td>
	</tr>
</table>
<script type="text/javascript"> 
function ajax_submit(){
	var name = $("#name").val(); 		
	if(name == ''){ $.alert('分组名称不能为空！');	return false;  }
	
	$.post('member.php?m=album&a=type_edit_save',
		{<{if $row.id}>id:<{$row.id}>,<{/if}> <{if $smarty.get.pid}>pid:<{$smarty.get.pid}>,<{/if}>  name:name},function(result){ 
		var data = jQuery.parseJSON(result);  
		if(data.error == '0'){
			<{if $row.id}>
				$(".atree_box_one.type_<{$row.id}> a span").html(name);
				ajax_close();
			<{else}> 
				// 添加
				html = '<div class="atree_box_one type_'+data.id+' ptype_<{$smarty.get.pid}>">'+
							'<a href="javascript:;" data-id="'+data.id+'"><i class="icon"></i><span>'+name+'</span></a>'+
						'</div>';
				if($('.atree_box_one.ptype_<{$smarty.get.pid}>').length > 0){
					$(".atree_box_one.ptype_<{$smarty.get.pid}>:last").after(html);
				}else{
					$(".atree_box_one.type_<{$smarty.get.pid}> a").after('<div class="atree_box">'+html+'</div>');
				} 
				ajax_close(); 
			<{/if}>
		}else{
			$.alert(data.msg);
		}
	}); 
} 
</script>