<form id="formAdd" method="post" action="?action=add">
<input type="hidden" name="dosubmit" value="1">
{?if $row.id>0?}<input type="hidden" name="id" value="{?$row.id?}">{?/if?}
<table width="100%" class="grid">
	<tr>
		<td class="tdleft" width="120"><span class="red">*</span> 角色名称：</td>
		<td><input type="text" class="text" name="rolename" id="rolename" size="25" maxlength="10" value="{?$row.rolename?}" /></td>
	</tr>
	<tr>
		<td class="tdleft">角色描述：</td>
		<td><input type="text" class="text" name="note" id="note" size="50" value="{?$row.note?}" /></td>
	</tr>
	<tr>
		<td class="tdleft">角色状态：</td>
		<td>
			<input type="radio" name="status" value="1"{?if $row.status=='1' || $row.status==''?} checked{?/if?}> 启用&nbsp;&nbsp; 
			<input type="radio" name="status" value="0"{?if $row.status=='0'?} checked{?/if?}> 禁用
		</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();})}});
	$("#rolename").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>