<!doctype html>
|
<html class="no-js">
|
<head>
|
<meta charset="utf-8">
|
<title>新增链接</title>
|
|
[#include "/business/pages/include/static.html" /]
|
[#include "/component/HtmlEditor.html" /]
|
</head>
|
<body class="edit_txt_body">
|
|
<script type="text/javascript">
|
$(function() {
|
$.formValidator.initConfig({formID:"myform",onError:function(msg){popupTips(msg)},onSuccess:function(){
|
document.getElementById("myform").target = window.top.openDialog("1","操作",
|
{},
|
{"width":40,"height":40},[{btnId:"tipBtnSure", btnName:"确定", btnStyle:"bluebtn"}]);
|
return true;
|
}});
|
|
|
$("#title").formValidator({empty:false,onShow:"请填写标题",onFocus:"标题不能为空!"}).inputValidator({min:1,max:100,onError:"分类名称长度不能超过100个字符!"});
|
$("#image").formValidator({empty:false,onShow:"请选择标题图片",onFocus:"标题图片不能为空!"}).regexValidator({
|
regExp : "picture1",
|
dataType : "enum",
|
onError : "错误的图片格式,格式如:jpg,jpeg,png,gif"
|
});
|
$("#ordernum").formValidator({empty:false,onShow:"请输入顺序号",onFocus:"请输入顺序号"}).inputValidator({min:1,max:5,onError:"顺序号必须为1到5位数字"})
|
.regexValidator({regExp:"intege", dataType:"enum", onError:"顺序号必须为1到5位数字"});
|
$("#content").formValidator({onshow:"内容不能为空",onFocus:"内容不能为空"}).functionValidator({
|
fun:function(val,elem){
|
var text = content.isEmpty();
|
if(text) {
|
return "请输入内容";
|
}
|
return true;
|
}
|
});
|
})
|
</script>
|
|
<div class="edit_txt">
|
<form action="updateLinkSubmit.html" method="post" id="myform" name="myform" enctype="multipart/form-data">
|
<input type="hidden" name="id" value="${RequestParameters.id!link.ID}" />
|
<input type="hidden" name="categoryId" value="${link.CATEGORY_ID}" />
|
<table class="edit_layout" width="99%">
|
<tr>
|
<th ><label class="required" >标题:</label></th>
|
<td><input name="title" class="general" style="height:20px;width:300px;" id="title" value="${link.TITLE}"/>
|
<div id="titleTip" style="display:inline-block;width: 300px;"></div>
|
</td>
|
</tr>
|
[#if linkCategory.TITLEIMAGE == 1]
|
<tr>
|
<th><label class="required" >图片:</label></th>
|
<td><input type="file" name="image" >
|
<input type="hidden" value="${link.TITLEIMAGE}" name="titleimage"/>
|
<div id="titleimageTip" style="width:250px;"></div>
|
</td>
|
</tr>
|
|
<tr>
|
<th></th>
|
<td>
|
<img src="${base}${link.TITLEIMAGE}"/>
|
</td>
|
</tr>
|
[/#if]
|
[#if linkCategory.SUMMARY == 1]
|
<tr>
|
<th><label class="required" >摘要:</label></th>
|
<td>
|
<textarea rows="5" cols="100" name="summary" class="general">${link.SUMMARY}</textarea>
|
</td>
|
</tr>
|
[/#if]
|
[#if linkCategory.CONTENT == 1]
|
<tr>
|
<th><label class="required" >内容:</label></th>
|
<td>
|
[@htmleditor id="content" value="${link.CONTENT}" /]
|
</td>
|
</tr>
|
[/#if]
|
<tr>
|
<th><label class="required" >强制URL:</label></th>
|
<td>
|
<input name="theurl" class="general" style="width:500px;height:20px;" id="theurl" value="${link.THEURL}"/>
|
</td>
|
</tr>
|
<tr>
|
<th><label class="required" >顺序号:</label></th>
|
<td>
|
<input name="ordernum" class="general" style="width:100px;height:20px;" id="ordernum" value="${link.ORDERNUM}"/>
|
<div id="ordernumTip" style="display:inline-block;width:250px;"></div>
|
</td>
|
</tr>
|
</table>
|
</form>
|
</div>
|
|
|
|
<script type="text/javascript">
|
function onDialogBtnClick(btnID, dialogID, config){
|
if(btnID == "btnSure"){
|
$("#myform").submit();
|
}
|
}
|
|
</script>
|
|
|
</body>
|
</html>
|