主题: 我在使用上传框,如何动态加载多个上传按钮? |
作者: zhl1015, 发布日期: 2012-01-10 11:28:27, 浏览数: 4337 |
<script type="text/javascript">
var upEditor; KindEditor.ready(function(K) { upEditor = K.editor({ uploadJson : '../kindeditor/asp/upload_json.asp', fileManagerJson : '../kindeditor/asp/file_manager_json.asp', allowFileManager : true }); K('#upImgBtn').click(function() { upEditor.loadPlugin('image', function() { upEditor.plugin.imageDialog({ imageUrl : K('#upImgIpt').val(), clickFn : function(imageUrl, title, width, height, border, align) { K('#upImgIpt').val(imageUrl); upEditor.hideDialog(); } }); }); }); }); </script>
<input id="upImgIpt" type="text" name="pic">
这是一个上传按钮,我已经实现可以增加按钮和文本框,但却注册不了事件
<input id="upImgIpt1" type="text" name="pic">
<input id="upImgIpt2" type="text" name="pic"> |
作者: wfyu0502, 发布日期: 2012-11-23 16:51:02 |
<% for i=1 to shu %>
<tr> <td class="tong_biaoz">图片<%=i%>:</td> <td class="tong_biaoy"> <script> KindEditor.ready(function(K) { var editor = K.editor({ uploadJson : '../../editor/asp/upload_json.asp?sortType=1&action=img&username=<%=shouji%>&diqu=<%=shipinyin%>&tuw=600&tuh=600', fileManagerJson : '../../editor/asp/file_manager_json.asp?sortType=1&action=img&username=<%=shouji%>&diqu=<%=shipinyin%>', allowFileManager : true }); K('#image<%=i%>').click(function() { editor.loadPlugin('image', function() { editor.plugin.imageDialog({ imageUrl : K('#url<%=i%>').val(), clickFn : function(url, title, width, height, border, align) { K('#url<%=i%>').val(url); editor.hideDialog(); } }); }); }); }); </script> <input class="input" type="text" name="tu<%=i%>" id="url<%=i%>" style="WIDTH:503px" value="" /> <input class="submit" type="button" id="image<%=i%>" value="选择图片" /> <a class="info" href="#"><img src="../images/help.gif" border="0"><span>选择房屋展示图片,图片格式只支持:gif,jpg,jpeg三种,图片大小为:宽:600象素,高:600象素</span></a> </td> </tr> <% next %> <tr> |
回复 |