<form id="formAdd" method="post" action="?action=add">
<input type="hidden" name="dosubmit" value="1">
{?if $row.tagid>0?}<input type="hidden" name="tagid" value="{?$row.tagid?}">{?/if?}
<table width="100%" class="grid">
	<tr>
		<td class="tdleft" width="120">TAG名称：</td>
		<td><input type="text" class="text" name="tagname" id="tagname" size="20" maxlength="10" value="{?$row.tagname?}" /></td>
	</tr>
	<tr>
		<td class="tdleft">所属分类：</td>
		<td>
			<select name="cid"><option value="0">不分类</option>{?$cates?}</select>
		</td>
	</tr>
</table>
<div><input type="submit" name="submit" id="submit" class="button dodialog" value="提 交"/></div>
</form>
<script type="text/javascript">
$(function(){
	$.formValidator.initConfig({formid:"formAdd",autotip:true,onerror:function(msg,obj){window.top.art.dialog({content:msg,lock:true,width:'250',height:'50'}, function(){this.close();$(obj).focus();})}});
	$("#tagname").formValidator({onshow:"请输入TAG名称",onfocus:"请输入TAG名称",oncorrect:"输入正确"}).inputValidator({min:1,onerror:"TAG不能为空"});
	$("#formAdd").ajaxForm({
        dataType: "json",
        success : function(data){
			if(data.flag == 0){
				doTip(data.msg);
			}else{
				window.top.mainframe.location.reload();
				doDialogClose();
			}
        }
    });
})
</script>