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 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Dec 2005
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Is it possible to insert text with a link?

    I am trying to find a way to create text in a textbox by clicking on a picture. I have been trying with onClick but i have not found any results. I was wondering if anyone could assist me.

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <title>Untitled Document</title>
    <script type="text/javascript">
    <!--
    function loadText(what,where){
    	document.getElementById(where).value=what;
    }
    //-->
    </script>
    </head>
    
    <body>
    <img src="image1.jpg" onclick="loadText('this is text','thebox')" alt=""><br>
    <img src="image2.jpg" onclick="loadText('this is also text','thebox2')" alt=""><br>
    <img src="image3.jpg" onclick="loadText('this is more text','thebox3')" alt=""><br>
    <form action="#" method="post">
    <input type="text" name="thebox" id="thebox"><br>
    <input type="text" name="thebox2" id="thebox2"><br>
    <input type="text" name="thebox3" id="thebox3">
    </form>
    </body>
    </html>
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #3
    New to the CF scene
    Join Date
    Dec 2005
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    thank you much


  •  

    Posting Permissions

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