<form id="formAdd" method="post" action="?action=add">
<input type="hidden" name="dosubmit" value="1">
{?if $row.linkid>0?}<input type="hidden" name="linkid" value="{?$row.linkid?}">{?/if?}
<table width="100%" class="grid">
	<tr>
		<td class="tdleft" width="80">链接名称：</td>
		<td><input type="text" class="text" name="title" id="title" size="30" maxlength="50" value="{?$row.title?}"/></td>
	</tr>
	<tr>
		<td class="tdleft">链接URL：</td>
		<td><input type="text" class="text" name="url" id="url" size="30" value="{?$row.url?}" /></td>
	</tr>
	<tr>
		<td class="tdleft">链接类型：</td>
		<td>
			<input type="radio" name="type" value="1"{?if 0==$row.type?} checked{?/if?}> 文字&nbsp;&nbsp; 
			<input type="radio" name="type" value="0"{?if 1==$row.type?} checked{?/if?}> 图片
		</td>
	</tr>
	<tr>
		<td class="tdleft">链接图片：</td>
		<td><input type="text" class="text" name="logo" id="logo" size="50" value="{?$row.logo?}" /></td>
	</tr>
	<tr>
		<td class="tdleft">链接介绍：</td>
		<td><input type="text" class="text" name="intro" id="intro" size="50" value="{?$row.intro?}" /></td>
	</tr>
	<tr>
		<td class="tdleft">联系方式：</td>
		<td><input type="text" class="text" name="contact" id="contact" size="50" value="{?$row.contact?}" /></td>
	</tr>
	<tr>
		<td class="tdleft">排序：</td>
		<td><input type="text" class="text" name="listorder" size="10" value="{?$row.listorder?}" /></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();})}});
	$("#title").formValidator({onshow:"请输入链接名称",onfocus:"链接显示名称",oncorrect:"输入正确"}).inputValidator({min:1,onerror:"请输入链接名称"});
	$("#url").formValidator({onshow:"请输入链接URL",onfocus:"链接URL",oncorrect:"输入正确"}).inputValidator({min:1,onerror:"请输入链接URL"}).regexValidator({regexp:"url",datatype:"enum",onerror:"链接URL格式错误"});
	$("#formAdd").ajaxForm({
        dataType: "json",
        success : function(data){
			if(data.flag == 0){
				doTip(data.msg);
			}else{
				window.top.mainframe.location.reload();
				doDialogClose();
			}
        }
    });
})
</script>