Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 09-22-2011, 11:26 AM   PM User | #1
4jd
New Coder

 
Join Date: Sep 2011
Posts: 25
Thanks: 4
Thanked 0 Times in 0 Posts
4jd is an unknown quantity at this point
Question 2 input file types need same value

Hi All

Code:
<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 )
</div>
<br class="clearBoth">
</div>
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....
Code:
$('#message').change(function() {
      $('#attrib-4-0').val($(this).val());
});
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....

--------------
Jay
4jd is offline   Reply With Quote
Old 09-22-2011, 05:37 PM   PM User | #2
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,168
Thanks: 59
Thanked 3,993 Times in 3,962 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
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.
__________________
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.
Old Pedant is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 08:13 PM.


Advertisement
Log in to turn off these ads.