View Full Version : 2 input file types need same value

09-22-2011, 12:26 PM
Hi All

<div class="wrapperAttribsOptions">
<h4 class="optionName back"><label class="attribsUploads" for="attrib-5-0">photo</label></h4>
<div class="back">
<input name="id[TEXT_PREFIX5]" id="attrib-5-0" type="file"><br>
<input name="UPLOAD_PREFIX1" value="5" type="hidden">
<input name="TEXT_PREFIXUPLOAD_PREFIX1" type="hidden"> ( +0.50 )
<br class="clearBoth">

This pice of code is dynamically created by my shopping carts admin section which is an attribute for a certain product.
The problem I have is that all the attributes are displayed in an array and positioning each is not possible (well, I have posted a query in another forum with regards to that). I have taken the code, as viewed in the source code, and added it in where I please e.g. radio buttons, checkboxes etc, which function perfectly.

This does make 'duplicate' field but I have used display:none on the generated code which hides it. I have found a snippet of code which fixes issues will type=text fields....

$('#message').change(function() {

but this can not be done when it comes to type=file.

Once you browse and select your image, i need the directory to be entered into the 'real' field for uploading when submitted.

Could anyone help me with this?

Thanks in advance if anyone can....


Old Pedant
09-22-2011, 06:37 PM
Assuming I understand the question...

Can't be done, in general.

<input type="file"> is special. You aren't allowed to use script to put a value into it.

So you can't even copy the contents of one <input type="file"> to another.