Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    4jd
    4jd is offline
    New Coder
    Join Date
    Sep 2011
    Posts
    25
    Thanks
    4
    Thanked 0 Times in 0 Posts

    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

  • #2
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,189
    Thanks
    75
    Thanked 4,341 Times in 4,307 Posts
    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.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •