cy
2022-06-21 129904537f66509f97b285e7eb4f42b3dc349dd0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
<!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>