Current location: Hot Scripts Forums » General Web Coding » JavaScript » Err I know what I want but dont know what the functions called.


Err I know what I want but dont know what the functions called.

Reply
  #1 (permalink)  
Old 11-25-03, 07:48 PM
DAL's Avatar
DAL DAL is offline
Code Master
 
Join Date: Jun 2003
Location: North East England/UK
Posts: 874
Thanks: 0
Thanked 0 Times in 0 Posts
Question Err I know what I want but dont know what the functions called.

I currently have a board system that works the usual way as expected. I have one problem with it though. When you fill the form in for a reply (or starting a new thead) I have a java popup window with a list of emoticons. The format of the emoticons are a bit different to the normal way heres a list ;
<> Smile/Happy
<> Cheesy Smile/Grin
<D> Very Happy/Massive Grin
<=)> Content/No Expression
<\I> Sad/A bit worried
<}(> Unhappy/P'ed Off!
<}b> Angry/Worked up
<{D> Worried/Concerned
<{o> Supprised/Astonished
<!I> Check Left/Cheeky Grin
<iI> Check Right/Cheeky Grin
<}8k> Evil/Vampire
<SS> Confused/Stupid
<6F> Beaten up/Black Eye
<o8(> Hole in the Head
<[]i> Bandit
<8=> Psycho/Silence of the lambs
<(.)> Wiped out!
<EMM> Eminem 'Wanna-be'
<1A1> One un One
<?> Question mark
<!> Exclamation Point
<Yes> Yes
<No> No

I have my reasons for putting the '<' '>' around the emoticon.

What I want is for a user to click on say the first emoticon (smile/happy) and the chr return to the main window and are entered into the form body. At the moment this has to be a process of manual entry or copy and paste.

Heres my code if you can suggest anything;

...ead>
<script language="javascript">
<!--
function emoticonswindow()
{
window.open('/Internal/emoticons.html','Emoticons','width=300,height=525 left=100, top=100,');

}
//-->
</script>
<title>$FORM{BoardName}</title>

<meta http-eq...

<form name="form1" method="post" action="Addpost.pl?\$thefile">
<p> <font color="#FFFFFF" size="2" face="Arial, Helvetica, sans-serif">Subject</font>
<input type="text" name="MSubject">
<br>
<br>
<a href="javascript:emoticonswindow()"><img src="/Internal/Graphix/Other/Boards/Message_button3.gif" width="95" height="24" border=0></a><img src="/Internal/Graphix/Other/Boards/Message_button4.gif" width="126" height="24" border=0><br>
<font face="Arial, Helvetica, sans-serif" size="2" color="#FFFFFF">Message</font>
<textarea name="MMessage" value="" cols="50" rows="10"></textarea>
<br>
<input type="submit" name="Submit" value="Submit">
</p>
</form>

Above is the page where the popup is called from
below is the code for the emoticons html page;
(Only the top 2 emots are shown in this code as the full list of the file would only overwelm the board and look messy)

<html>
<head>
<title>Emoticons Selection</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="Standard.css" type="text/css">

</head>

<body bgcolor="#1A71D2" text="#000000">
<div align="center">
<table width="284" border="0" cellpadding="0" cellspacing="0" height="500">
<tr bgcolor="#006699">
<td width="23" height="18" valign="top">
<div align="center"><font size="1" color="#FFFFFF" face="Arial, Helvetica, sans-serif">Icon</font></div>
</td>
<td width="84" height="18" valign="top">
<div align="center"><font size="1" face="Arial, Helvetica, sans-serif" color="#FFFFFF">Copy
this to get</font></div>
</td>
<td valign="top" width="177" height="18">
<div align="center"><font size="1" color="#FFFFFF" face="Arial, Helvetica, sans-serif">Description</font></div>
</td>
</tr>
<tr bgcolor="#0066CC">
<td valign="top" height="20" bgcolor="#0066CC"><font face="Arial, Helvetica, sans-serif" size="1" color="#FFFFFF"><img src="Graphix/Other/Boards/Emoticons/Emot1.gif" width="20" height="20">
</font></td>
<td valign="top" align="center">
<p align="center"><font face="Arial, Helvetica, sans-serif" size="3" color="#FFFFFF">&lt;&gt;</font></p>
</td>
<td valign="top" align="left"><font size="1" color="#FFFFFF" face="Arial, Helvetica, sans-serif"><font size="2">Smile/Happy</font></font></td>
</tr>
<tr bgcolor="#006699">
<td bgcolor="#0066CC" height="18"><img src="Graphix/Other/Boards/Emoticons/Emot2.gif" width="20" height="20"></td>
<td valign="top" align="center"><font face="Arial, Helvetica, sans-serif" size="3" color="#FFFFFF">&lt;&gt;</font></td>
<td><font face="Arial, Helvetica, sans-serif" size="2" color="#FFFFFF">Cheesy
Smile/Grin</font></td>

Thanks
DAL
__________________
"once upon a midnight dreary, while i pron surfed, weak and weary, over many a strange and spurious site of 'hot xxx galore'. While i clicked my fav'rite bookmark, suddenly there came a warning, and my heart was filled with mourning, mourning for my dear amour," 'Tis not possible!", i muttered, "give me back my free hardcore!" quoth the server, 404."
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 11-28-03, 03:16 PM
melsana melsana is offline
Newbie Coder
 
Join Date: Nov 2003
Location: MD
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
It is hard for me to visuallize your code so I'm not sure eactly where you would put this...

But where ever you want the person to click you would put

onClick=sendBack(":-)") or whatever string you want sent back to the text area...

Then in the javascript use

function sendBack(myString) {
var txt = opener.document.form1.MMessage.value
opener.document.form1.MMessage.value = txt+myString
}

I haven't tested this but in theory it should work.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
VBscript... math functions and stuff that hurts my brain. Mister B. ASP 0 08-31-03 02:04 PM
Array passing between functions alfreds PHP 1 08-25-03 06:29 AM
Optimizing functions amidamaru PHP 7 08-08-03 06:56 PM
User Functions DA Master PHP 4 06-15-03 06:00 AM
Need more functions for my wysiwyg editor klausre PHP 3 06-14-03 12:35 PM


All times are GMT -5. The time now is 11:01 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.