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 5 of 5
  1. #1
    New Coder
    Join Date
    Oct 2006
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Need help with Message Form and Images

    Hi,
    I'm working on a form for visitors messages. I'd like to add a row of several images, that when clicked they add text in the message area where the cursor is located. In the example that I've included I'd just like to have the word "[This]" added when the visitor clicks the This.gif button image, etc.
    I'd appreciate any help or examples that I can use to make this work in my Message Form.
    Thanks,
    Terry

    Code:
    <html>
    <head>
    <title>Message Form</title>
    </head>
    <body>
    <form method="POST" action="/cgi-bin/cgiemail/websitename/cgidata.dat">
    <p><img border="0" src="This.gif" width="20" height="20">
    <img border="0" src="That.gif" width="20" height="20">
    <p>Message:<br>
    <textarea name="message" rows="10" cols="70" wrap></textarea>
    <p><input type="submit" value="Submit"></p>
    </form>
    </body>
    </html>

  • #2

  • #3
    New Coder
    Join Date
    Oct 2006
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thumbs up

    Hi twodayslate,
    Thanks for the great links. I'm new here and I appreciate your help.
    Thanks again,
    Terry Cadd

  • #4
    New Coder
    Join Date
    Oct 2006
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi,
    I am looking for a script function similar to the AddWord function that I worked up below. The script function needs to be like an InsertWord function that inserts the word where the cursor is located. It will work just like adding smilie icons to your message when you go to post a message here. This is the version that I've worked up with the AddWord function for an example.
    Thanks for your help.
    Terry

    Code:
    <html>
    <head>
    <title>Insert Icon</title>
    <script>
    function AddWord(word)
     { 
      document.getElementById('required-message').value=document.getElementById('required-message').value + word; 
     }
    </script>
    </head>
    <body>
    <p align="center"><b>Insert Icon</b></p>
    <form method="POST" action="/cgi-bin/cgiemail/websitename/someform.cgi">
    <center>
    <a title="Smile"><img border="0" src="{Smile}.gif" onclick="AddWord('{Smile}');" width="16" height="16"></a>
    <a title="Frown"><img border="0" src="{Frown}.gif" onclick="AddWord('{Frown}');" width="16" height="16"></a>
    <br>
    <textarea name="required-message" rows="9" cols="30" wrap></textarea>
    <br>
    <input type="submit" value="Submit">
    </form>
    </body>
    </html>

  • #5
    Senior Coder twodayslate's Avatar
    Join Date
    Mar 2007
    Location
    VA
    Posts
    1,042
    Thanks
    67
    Thanked 39 Times in 39 Posts
    give us a url to your site.
    twitter | Quality Hosting - $5.95/mo*
    Feel free to PM me!


  •  

    Posting Permissions

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