主题: 请问一个页面多个upload怎么设置?
作者: zjdjmc, 发布日期: 2013-12-10 15:38:56, 浏览数: 3709
<link rel="stylesheet" href="{ywcms::C('site_url')}/kindeditor/themes/default/default.css" />
<link rel="stylesheet" href="{ywcms::C('site_url')}/kindeditor/plugins/code/prettify.css" />
<script src="{ywcms::C('site_url')}/kindeditor/kindeditor.js" type="text/javascript"></script>
<script src="{ywcms::C('site_url')}/kindeditor/lang/zh_CN.js" type="text/javascript"></script>
<script src="{ywcms::C('site_url')}/kindeditor/plugins/code/prettify.js" type="text/javascript"></script>
<script>
KindEditor.ready(function(K){
var editor = K.editor({
allowFileManager:true
});
K('#upload').click(function() {
editor.loadPlugin('image', function() {
editor.plugin.imageDialog({
fileUrl : K('#pic').val(),
clickFn : function(url, title) {
if(url.indexOf("http") > -1){
K('#pic').val(url);
}else{
K('#pic').val("{ywcms::C('site_url')}"+url);
}
editor.hideDialog();
}
});
});
});
});
</script>




1.
<td><input type="text" name="picurl" value="" class="px h23 w550" id="pic">

<span class="ke-button-common" id="upload" style="margin-top: 3px;margin-left: 5px;"><input type="button" class="ke-button-common ke-button" value="Upload"></span>

2.

<td><input type="text" name="picurl" value="" class="px h23 w550" id="pic">
<span class="ke-button-common" id="upload" style="margin-top: 3px;margin-left: 5px;"><input type="button" class="ke-button-common ke-button" value="Upload"></span>

3.

<td><input type="text" name="picurl" value="" class="px h23 w550" id="pic">
<span class="ke-button-common" id="upload" style="margin-top: 3px;margin-left: 5px;"><input type="button" class="ke-button-common ke-button" value="Upload"></span>




请问,我怎样加多个upload?比如我一个页面有3个upload怎么搞?

作者: 小浪子, 发布日期: 2013-12-10 16:49:48
回复
作者: zjdjmc, 发布日期: 2013-12-10 18:15:10

回复小浪子:


本人比较菜,能否帮我写下?谢谢

回复
作者: 晚风依染, 发布日期: 2013-12-11 16:13:53
每个上传按钮用不同的ID,然后每个按钮都写一个click函数,每个函数都调用不同editor。
回复
发表新帖 发表回复