www.webdeveloper.com
+ Reply to Thread
Results 1 to 6 of 6
  1. #1
    Join Date
    Nov 2011
    Posts
    31

    Load form and dispay image

    Hi,
    I'm loading a webpage that has a form. The form dispays values from a database:

    product_barcode;
    product_name;
    product_value;

    I wan´t to dispay the image of the product when the page loads using the value in the "product_barcode" field ( all images are in a folder with the name "barcode.jpg").

    I tried to dispay the image using javascript and getElementByID('product_barcode').value +.jpg in the HTML but it dosen't work.

    Can anyone help me on this?
    Thank You!
    RESA

  2. #2
    Join Date
    May 2006
    Location
    Russia, Rostov-on-Don
    Posts
    1,132
    it seems you missed the folder name:

    Code:
    var imgSrc='foldername/'+getElementById('product_barcode').value+'.jpg';
    use [code]YOUR CODE GOES HERE[/code] or burn in Hell

  3. #3
    Join Date
    Nov 2011
    Posts
    31
    Hi Padonak,

    And how I display in the HTML the var imgSrc?

    Thanks!
    RESA

  4. #4
    Join Date
    May 2006
    Location
    Russia, Rostov-on-Don
    Posts
    1,132
    something like this
    use [code]YOUR CODE GOES HERE[/code] or burn in Hell

  5. #5
    Join Date
    Nov 2011
    Posts
    31
    Hi Padonak,

    Thank you!

    It works fine

    BR
    RESA

  6. #6
    Join Date
    May 2006
    Location
    Russia, Rostov-on-Don
    Posts
    1,132
    good to hear )
    use [code]YOUR CODE GOES HERE[/code] or burn in Hell

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Bookmarks

Posting Permissions

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



Recent Articles