简体   繁体   English

Uploadify同一页面上的多个实例不起作用

[英]Uploadify Multiple instances on same page not working

I am using following syntax. 我正在使用以下语法。 I have searched around but I haven't been able to resolve the issue. 我已经搜索了一下,但无法解决问题。 Anyway I have following code in a while loop 无论如何,我在while循环中有以下代码

<input type=\"file\" name=\"bulkupload[]\" id=\"bulkimgupload\" class=\"bulkupload\" prodid=\"$pid\"/>

And following is the jquery part 接下来是jQuery部分

    $('.bulkupload').each(function() {
    var $bulkupload = $(this);
    $bulkupload.uploadify({
        'swf'      : 'uploadify.swf',
        'uploader' : 'bulkupload.php',
        'buttonText':   'Upload Images',
    });
    });

Weirdly it only runs for the first instance and shows simple file upload button on all the later ones. 奇怪的是,它仅在第一个实例上运行,并在所有后续实例上显示简单的文件上传按钮。

The ID should be unique for each input 每个输入的ID应该是唯一的

id=\"bulkimgupload_1\" , id=\"bulkimgupload_2\" ...etc

Maybe you can append the $pid like 也许你可以像这样附加$ pid

id=\"bulkimgupload_$pid\"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM