Results 1 to 1 of 1

Thread: onClick copy image url into input field and display image

  1. #1
    Join Date
    Jun 2013
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default onClick copy image url into input field and display image

    I have a plugin that let you add text over an image. If you add the URL of the image into a field it loads the image on the left side and let you add some text over it..

    what i really want is to display an image gallery so when i click over an image it will copy the source to into a field and loads the image automatically..

    I'm getting the image source into input field when i click over the image with the script below but its not loading the image on the left side... I'm just getting the source but not loading the image on the left side...

    This is the plugin www.chistesdominicanos.com/editordememe ... if you click the image of the guy with the bottle at the bottom of the page it will copy the image source into the URL field but its not loading the image on the left... If you do it manually Copy/Paste the URL its going to work... can you please tell me what im doing wrong?

    Code:
    <script type="text/javascript">
    function clicked(address) {
    document.getElementById('meme-image-url-0').value = address.src;
      document.getElementById('meme-top-text-0').focus();
    }
    
    <form>
    <label for="copy_img">Image</label>
    <input type="text" name="meme-image-url-0" id="meme-image-url-0" />
    
    </form>
    <li><img src="http://www.iltlaugh.com/wp-content/uploads/2012/10/437273.jpg" onclick="clicked(this)"/></li>
    </ul>
    Last edited by james438; 06-18-2013 at 05:21 AM. Reason: format for code

Similar Threads

  1. onClick copy image url into input field
    By bokanegro in forum JavaScript
    Replies: 4
    Last Post: 05-29-2013, 12:53 AM
  2. jquery copy input to other input
    By nicmo in forum JavaScript
    Replies: 4
    Last Post: 09-26-2010, 01:52 PM
  3. Replies: 1
    Last Post: 10-26-2008, 04:27 PM
  4. Input type="image" ONCLICK
    By hantz in forum JavaScript
    Replies: 3
    Last Post: 02-09-2008, 02:11 PM
  5. Replies: 0
    Last Post: 12-27-2007, 06:47 AM

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
  •