Results 1 to 3 of 3

Thread: Load input field using a link?

  1. #1
    Join Date
    Aug 2010
    Posts
    8
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default Load input field using a link?

    Is there a way to load an input field using a link?

    So a search box is blank, but if the user clicks a link "Hello" the search box input field will then be loaded with the term "Hello".

  2. #2
    Join Date
    Sep 2007
    Location
    The Netherlands
    Posts
    1,881
    Thanks
    49
    Thanked 266 Times in 258 Posts
    Blog Entries
    56

    Default

    Try this:
    Code:
    <form>
    <input type="text" id="input_field" onclick="reset()">
    </form>
    
    <a href="javascript: void()" onclick="document.getElementById('input_field').value=this.innerHTML; return false">Hello</a>

  3. The Following User Says Thank You to molendijk For This Useful Post:

    jughead47 (02-17-2015)

  4. #3
    Join Date
    Aug 2010
    Posts
    8
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default

    Thank you!!!

Similar Threads

  1. How to validate input in RTE form field?
    By Colin in forum Dynamic Drive scripts help
    Replies: 3
    Last Post: 12-19-2009, 02:41 AM
  2. Dynamically add input field to page
    By mtran in forum JavaScript
    Replies: 1
    Last Post: 06-13-2008, 02:58 AM
  3. Input field help.
    By SDB in forum PHP
    Replies: 2
    Last Post: 12-06-2007, 10:29 AM
  4. dynamic input field
    By developing in forum Looking for such a script or service
    Replies: 0
    Last Post: 12-05-2007, 06:57 PM
  5. Field Input Limiter
    By quintin in forum Dynamic Drive scripts help
    Replies: 1
    Last Post: 03-08-2006, 10:00 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
  •