<form id="formAdd" method="post" action="?action=add">
<input type="hidden" name="dosubmit" value="1">
{?if $row.cid>0?}<input type="hidden" name="cid" value="{?$row.cid?}">{?/if?}
<table width="100%" class="grid">
	<tr>
		<td class="tdleft" width="120"><span class="red">*</span> 分类名称：</td>
		<td><input type="text" class="text" name="cname" id="cname" size="20" maxlength="20" value="{?$row.cname?}" /></td>
	</tr>
	<tr>
		<td class="tdleft"><span class="red">*</span> 英文别名：</td>
		<td><input type="text" class="text" name="alias" id="alias" size="20" value="{?$row.alias?}" /></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();})}});
	$("#cname").formValidator({onshow:"请输入分类名称",onfocus:"请输入分类名称",oncorrect:"输入正确"}).inputValidator({min:1,onerror:"请输入分类名称"});
	$("#alias").formValidator({empty:true,onshow:"请输入英文别名",onfocus:"英文别名不超过20个字符",oncorrect:"输入正确"}).regexValidator({regexp:"username",datatype:"enum",param:'i',onerror:"只能包括数字、字母、下划线三种类型。"});
	$("#formAdd").ajaxForm({
        dataType: "json",
        success : function(data){
			if(data.flag == 0){
				doTip(data.msg);
			}else{
				window.top.mainframe.location.reload();
				doDialogClose();
			}
        }
    });
})
</script>