I need the ability to have multiple boot inputs on the same page (potentially hundreds) using Uploadify. The PHP download file will rename the downloaded file based on the identifier of the enter button used to send it, so this identifier is required.
Since I will have hundreds of download buttons on one page, I would like to create a universal copy, so I did this using the form class, not the form identifier. However, when one of the inputs is pressed, I would like to pass the identifier of this input as scriptData for PHP. This does not work; PHP says that 'formId' is undefined.
Is there a good way to get the ID attribute of the form input used and pass it to downloadable PHP? Or is there a completely different and better way to achieve this? Thanks in advance!
<script type="text/javascript">
$(document).ready(function() {
$('.uploady').uploadify({
'uploader' : '/uploadify/uploadify.swf',
'script' : '/uploadify/uploadify.php',
'cancelImg' : '/uploadify/cancel.png',
'folder' : '/uploadify',
'auto' : true,
'scriptData' : {'formId':$(this).attr('id')}
});
});
</script>
</head>
The inputs are as follows:
<input id="file_upload1" class="uploady" name="file_upload" type="file" />
<input id="file_upload2" class="uploady" name="file_upload" type="file" />
<input id="file_upload3" class="uploady" name="file_upload" type="file" />
source
share