<form id="formAdd" method="post" action="?action=add">
<input type="hidden" name="dosubmit" value="1">
{?if $row.menuid>0?}<input type="hidden" name="menuid" value="{?$row.menuid?}">{?else?}<input type="hidden" name="pid" value="{?$row.pid?}">{?/if?}
<table width="100%" class="grid">
	<tr>
		<td class="tdleft" width="120"><span class="red">*</span> 菜单标题：</td>
		<td><input type="text" class="text" name="caption" id="caption" size="25" maxlength="10" value="{?$row.caption?}" /></td>
	</tr>
	<tr>
		<td class="tdleft">菜单链接：</td>
		<td>
			<input type="text" class="text" name="command" id="command" size="50" maxlength="100" value="{?$row.command?}" />
		</td>
	</tr>
	<tr>
		<td class="tdleft">排序：</td>
		<td><input type="text" class="text" name="listorder" id="listorder" size="25" maxlength="5" value="{?$row.listorder?}" onkeyup="value=value.replace(/[^0-9]/g,'');" /></td>
	</tr>
	<tr>
		<td class="tdleft">是否显示：</td>
		<td>
			<input type="radio" name="display" id="display" value="1" checked> 显示&nbsp;&nbsp; 
			<input type="radio" name="display" id="display" value="0"> 不显示
		</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();})}});
	$("#caption").formValidator({onshow:"请输入菜单标题",onfocus:"菜单标题不能超过10个中文",oncorrect:"输入正确"}).inputValidator({min:1,onerror:"请输入菜单标题"});	
	$("#formAdd").ajaxForm({
        dataType: "json",
        success : function(data){
			if(data.flag == 0){
				doTip(data.msg);
			}else{
				window.top.mainframe.location.reload();
				doDialogClose();
			}
        }
    });
})
</script>