<!doctype html>
|
<html class="no-js">
|
<head>
|
<meta charset="utf-8">
|
<title></title>
|
[#include "/business/pages/include/static.html" /]
|
</head>
|
<body class="edit_txt_body">
|
|
<script type="text/javascript">
|
$(function() {
|
//增加onchange事件;
|
var dateHtml=['<tr name="validHtml">',
|
'<th align="right"><label class="required">宽:</label></th>',
|
' <td><input type="text" value="${info.titleimage_width}" class="input-text" name="titleimage_width" id="titleimage_width"></input>',
|
' <div id="titleimage_widthTip" style="width:100px;"></div>',
|
'</td>',
|
'</tr>',
|
'<tr name="valid">',
|
'<th align="right"><label class="required">高:</label></th>',
|
' <td><input type="text" value="${info.titleimage_height}" class="input-text" name="titleimage_height" id="titleimage_height"></input>',
|
' <div id="titleimage_heightTip" style="width:100px;"></div>',
|
' </tr>'];
|
$("#thumbnail").change(function(){
|
|
var value = $("#thumbnail").val();
|
var trObj = $('#datatypeTr');
|
$("[name=validHtml]").remove();
|
$("[name=valid]").remove();
|
if(2==value||3==value){
|
trObj.after(dateHtml.join(''));
|
}
|
});
|
[#if info.ID??]
|
var value = '${info.THUMBNAIL}';
|
var trObj = $('#datatypeTr');
|
$("[name=validHtml]").remove();
|
$("[name=valid]").remove();
|
if(2==value||3==value){
|
trObj.after(dateHtml.join(''));
|
$("#titleimage_width").val('${info.TITLEIMAGE_WIDTH}');
|
$("#titleimage_height").val('${info.TITLEIMAGE_HEIGHT}');
|
}
|
[/#if]
|
$.formValidator.initConfig({formID:"myform",onError:function(msg){alert(msg)},onSuccess:function(){
|
document.getElementById("myform").target = window.top.openDialog("1","操作",
|
{},
|
{"width":40,"height":40},[{btnId:"tipBtnSure", btnName:"确定", btnStyle:"bluebtn"}]);
|
|
return true;
|
}});
|
|
|
$("#category_name").formValidator({empty:false,onShow:"请填写分类名称",onFocus:"分类名称不能为空!"})
|
.inputValidator({min:1,max:50,onError:"分类名称长度不能超过50个字符!"})
|
.ajaxValidator({
|
dataType : "html",
|
async : true,
|
data:"id=${info.ID}",
|
url : "${base}/business/pages/cms/page/checkClassifyName.html",
|
success : function(data){
|
if( data == 1 ) return true;
|
if( data == 0 ) return false;
|
return false;
|
},
|
buttons: $("#dosubmit"),
|
error: function(jqXHR, textStatus, errorThrown){alert("服务器没有返回数据,可能服务器忙,请重试"+errorThrown);},
|
onError : "该分类名称已存在,请更换",
|
onWait : "正在对分类名称进行校验,请稍候..."
|
});
|
|
$("#ordernum").formValidator({empty:false,onFocus:"请输入顺序号"})
|
.inputValidator({min:1,max:2,onError:"顺序号必须为1到2位数字"})
|
.regexValidator({regExp:"intege", dataType:"enum", onError:"顺序号必须为1到2位数字"});
|
|
$("#titleimage").formValidator({empty:false,onShow:"请选择",onFocus:"不能为空!"})
|
.inputValidator({min:1,onError:"请选择!"});
|
|
$("#content").formValidator({empty:false,onShow:"请选择",onFocus:"不能为空!"})
|
.inputValidator({min:1,onError:"请选择!"});
|
|
$("#summary").formValidator({empty:false,onShow:"请选择",onFocus:"不能为空!"})
|
.inputValidator({min:1,onError:"请选择!"});
|
|
$("#thumbnail").formValidator({empty:false,onShow:"请选择",onFocus:"不能为空!"})
|
.inputValidator({min:1,onError:"请选择!"});
|
});
|
|
</script>
|
|
<div class="edit_txt">
|
<form action="saveClassify.html" method="post" id="myform" name="myform" >
|
<input type="hidden" name="up_id" value="${info.UP_ID}" />
|
<input type="hidden" name="id" value="${info.ID}" />
|
<table class="edit_layout" width="99%">
|
<tr><th ><label class="required" >分类名称:</label></th>
|
<td><input class="general" type="text" name="category_name" id="category_name" value="${info.CATEGORY_NAME}"/>
|
<div id="category_nameTip" style="display:inline-block;width:180px;"></div>
|
</td>
|
</tr>
|
|
|
<tr><th><label class="required">显示顺序:</label></th>
|
<td ><input class="general" type="text" name="ordernum" id="ordernum" value="${info.ORDERNUM}"/>
|
<div id="ordernumTip" style="display:inline-block;width:180px;"></div>
|
</td>
|
</tr>
|
<tr>
|
<th ><label class="required">标题图片:</label></th>
|
<td>
|
<select id="titleimage" name="titleimage" style="width:180px;" class="general">
|
<option value="">请选择</option>
|
<option value="1" [#if info.titleimage==1]selected[/#if]>是</option>
|
<option value="2" [#if info.titleimage==2]selected[/#if]>否</option>
|
</select>
|
<div id="titleimageTip" style="display:inline-block;width:150px;"></div>
|
</td>
|
</tr>
|
<tr>
|
<th ><label class="required">内容:</label></th>
|
<td>
|
<select id="content" name="content" style="width:180px;" class="general">
|
<option value="">请选择</option>
|
<option value="1" [#if info.content==1]selected[/#if]>是</option>
|
<option value="2" [#if info.content==2]selected[/#if]>否</option>
|
</select>
|
<div id="contentTip" style="display:inline-block;width:180px;"></div>
|
</td>
|
</tr>
|
<tr>
|
<th ><label class="required">摘要:</label></th>
|
<td>
|
<select id="summary" name="summary" style="width:180px;" class="general">
|
<option value="">请选择</option>
|
<option value="1" [#if info.summary==1]selected[/#if]>是</option>
|
<option value="2" [#if info.summary==2]selected[/#if]>否</option>
|
</select>
|
<div id="summaryTip" style="display:inline-block;width:180px;"></div>
|
</td>
|
</tr>
|
<tr id="datatypeTr">
|
<th ><label class="required">缩略图:</label></th>
|
<td>
|
<select id="thumbnail" name="thumbnail" style="width:180px;" class="general">
|
<option value="">请选择</option>
|
<option value="1" [#if info.thumbnail==1]selected[/#if]>不启用</option>
|
<option value="2" [#if info.thumbnail==2]selected[/#if]>等比</option>
|
<option value="3" [#if info.thumbnail==3]selected[/#if]>强制</option>
|
</select>
|
<div id="thumbnailTip" style="display:inline-block;width:180px;"></div>
|
</td>
|
</tr>
|
<tr>
|
<th><label >备注:</label></th>
|
<td>
|
<textarea cols="10" class="general" style="width:90%; height:90px;" rows="4" name="note" id="note">
|
</textarea>
|
</td>
|
</tr>
|
|
</table>
|
</form>
|
</div>
|
|
|
|
<script type="text/javascript">
|
function onDialogBtnClick(btnID, dialogID, config){
|
if(btnID == "btnSure"){
|
var value = $("#thumbnail").val();
|
if(2==value||3==value){
|
var max= $.trim($("#titleimage_width").val());
|
var min= $.trim($('#titleimage_height').val());
|
if(max==''||min==''){
|
window.top.popupTips("宽和高不能为空");
|
return false;
|
}
|
var reg=/^\d*$/;
|
if(!reg.test(max)||!reg.test(min)){
|
window.top.popupTips("宽和高必须是数字");
|
return false;
|
}
|
}
|
$("#myform").submit();
|
}
|
}
|
|
</script>
|
|
|
</body>
|
</html>
|