求助 版主:官方研发技术组
求教thumb字段上传按钮定位的方法
类型:迅睿CMS 更新时间:2023-10-07 11:39:02 上传图片

先反馈个情况,我也不知道是不是问题

onblur="check_title();get_keywords('keywords');"
标题字段默认的表单附加属性 是上面这个
我再加上一句
onblur="check_title();get_keywords('keywords');" onmouseover="gocopytitle();"
保存后 会删掉后面新加的一个"双引号 前面原始的不删
onblur="check_title();get_keywords('keywords');" onmouseover=gocopytitle();"
在其他字段里面也一样会删掉后面左边的双信号 最前面的不删
只要是有空格 就会删个双引号 没空格不删
麻烦观察一下 看看

另外求教问题,麻烦指导一下。

系统thumb字段 添加了表单附加事件onclick="gocopytitle();"

我目标是想要加到 

<input type="file" name="file_data">这个“上传”按钮里面
结果是加到了 <input type="hidden" onclick="gocopytitle();" id="dr_thumb" name="data[thumb]" value="">存值的这个里面
当然其他的也都是加到存值的上面了


最终目的是 鼠标滑过或者点击“上传”按钮执行事件函数同时打开上传图片的窗口
<input type="file" name="file_data"> 这里缺ID
<script>
document.getElementById("gocopytitle").onmouseover = function () {
document.getElementById("dr_title").select();
document.execCommand("copy");
};
</script>
getElementByName也搞不到

有大佬说用JQ定位到 file_data 
哪个好心人给帮忙写一下啊


回帖
  • #1楼    迅睿框架创始人
    2023-10-07 08:19:49
    Google Pixel 手机 0

    image
    只能用于text字段,文件上传字段不合适
  • 未别离
    #2楼    未别离
    2023-10-07 11:39:02
    Chrome 0
    $("input[name=file_data]").click(function() {
    	var tt = $("#dr_title").val();
    	var png = ".png";
    	var ttpng = tt + png;
    	var tempInput = $("<input>");
    	$("body").append(tempInput);
    	tempInput.val(ttpng).select();
    	document.execCommand("copy");
    	tempInput.remove();
    });
    通过上面的代码选择到name="file_data"的文本框(单文件File的上传按钮