...

View Full Version : Need help with Message Form and Images



Terry Cadd
11-23-2008, 04:52 AM
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



<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>

twodayslate
11-23-2008, 10:21 PM
so you want button images?
http://www.alistapart.com/articles/prettyaccessibleforms
http://www.picment.com/articles/css/funwithforms/
http://www.whatstyle.net/articles/18/pretty_form_controls_with_css
http://www.webdevelopersnotes.com/tips/html/21.php3?x=85&y=20

Terry Cadd
11-24-2008, 01:47 AM
Hi twodayslate,
Thanks for the great links. I'm new here and I appreciate your help.
Thanks again,
Terry Cadd

Terry Cadd
12-10-2008, 06:23 AM
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. :thumbsup:
Terry



<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>

twodayslate
12-10-2008, 09:48 PM
give us a url to your site.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum