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

    Question 2 input file types need same value

    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....


  2. #2
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Thanked 4,947 Times in 4,908 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.
    Be yourself. No one else is as qualified.


Posting Permissions

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