OnComplete 事件插入输入值 - jQuery

发布于 2025-01-02 11:23:33 字数 450 浏览 5 评论 0原文

我有一个问题。

我正在使用 jQuery 插件 Uploadify v. 2.1.4 上传一些 *.pdf 文件。

Uploadify有OnComplete事件回调函数。此事件在您的参数中返回发送的文件名。

我创建了一个带有 id #pdf_name 的隐藏输入,我希望当 oncomplete 函数执行时,他将文件名参数传递给隐藏输入,从而更改您的值。

我不知道如何使用 jQuery 在输入中“插入”一个值。

有人有解决办法吗?

http://www.uploadify.com/documentation/events/oncomplete-2/

谢谢, 路易斯·H.

I have a problem.

I'm using the jQuery plugin Uploadify v. 2.1.4 to upload some *.pdf files.

The Uploadify have the OnComplete event callback function. This event returns in your arguments the file name sended.

I created a input hidden with id #pdf_name, where i want when the oncomplete function executes, him pass the file name argument to the input hidden, changing your value.

I don't know how i can "insert" an value inside a input with the jQuery.

Anyone have a solution?

http://www.uploadify.com/documentation/events/oncomplete-2/

Thanks,
Luiz H.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

风苍溪 2025-01-09 11:23:33

试试这个: http://jsfiddle.net/2ZfLG/

var fileName = name_argument;
$('#pdf_name').attr('value',fileName); //set value of the input field

try this: http://jsfiddle.net/2ZfLG/

var fileName = name_argument;
$('#pdf_name').attr('value',fileName); //set value of the input field
难理解 2025-01-09 11:23:33

这确实是非常基本的 jQuery:

$("#pdf_name").val(filename_argument);

如果“input id =”#pdf_name”包含 # 符号,您将需要从 id 中删除“#”(建议),或者向 jQuery 选择器添加另一个“#”。

This is really very basic jQuery:

$("#pdf_name").val(filename_argument);

if the "input id = "#pdf_name" includes the # sign you will either need to remove the "#" from the id (suggested) or add another "#" to the jQuery selector.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文