/    Sign up×
Community /Pin to ProfileBookmark

Inputting Text to TextArea From PopUp Window

I run a forum and have chosen to have 80×80 pixel smilies on it as a great majority of the users are broadband users. However for the dialup users this creates a bandwidth problem.

My solution was to have a popup window open when the user presses SMILIE CONTROL PANEL which will have rows and rows of 80×80 smilies. This makes broadband users happy and also dialup users happy as they don’t HAVE to download the smilies whenver they want to post a message, it’s an option.

I have created the popup window full of smilies and the code is as follows:

[code]
<script language=”JavaScript1.2″ type=”text/javascript”>
document.write(‘<a href=javascript:adds(“[img]http://www.myhost/img/GoodKid.gif[/img]”,”srs”)><IMG SRC=”http://www.myhost/img/GoodKid.gif” BORDER=0></a> ‘);
</script>
[/code]

and then in my forum page header i have

[code]<Frame name=”srs”>
[/code]

but the forum page isn’t displaying anything?

What I planned for was to have the user click on a smilie and in the messagebody(textarea) a – of course with the right img tags but i can’t write that

[code]
[imghttp://www.myhost/img/goodkid.gif/img] [/code]

to appear

Any ideas?

to post a comment
JavaScript

4 Comments(s)

Copy linkTweet thisAlerts:
@FangOct 21.2004 — From the popup you could use something like:
&lt;a href="javascript: opener.document.formName.textareaName.value+='[img]goodkid[/[img]';"&gt;
&lt;img src="http://www.myhost/img/goodkid.gif" alt="goodkid :)" title="goodkid :)"&gt;
&lt;/a&gt;
Copy linkTweet thisAlerts:
@rlsajauthorOct 21.2004 — [i]Originally posted by Fang [/i]

[B]From the popup you could use something like:

&lt;a href="javascript: opener.document.formName.textareaName.value+='[img]goodkid[/[img]';"&gt;
&lt;img src="http://www.myhost/img/goodkid.gif" alt="goodkid :)" title="goodkid :)"&gt;
&lt;/a&gt;
[/B][/QUOTE]


ok, so I am posting exactly this

<a href="javascript:opener.document.postmodify.message.value+='[img]image[/[img]';">

<img src="http://home.images.mine/image.jpg" alt="image ?" title="image ?">

</a>


where postmodify = form

and message = textarea name

let me try and understand this, opener is saying focus on page that opened window ie the forum?

and still no

I know I am missing something?
Copy linkTweet thisAlerts:
@FangOct 21.2004 — Has to be done through the 'onclick':
&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd"&gt;
&lt;html lang="en"&gt;
&lt;head&gt;
&lt;title&gt;Smile to Parent page&lt;/title&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8"&gt;
&lt;script type="text/javascript"&gt;
&lt;!--
function OpenWin() {
var content='&lt;a href="#" onclick="opener.document.postmodify.message.value+=&amp;#92;'[img]image[/img]&amp;#92;'; return false;"&gt;'+
'&lt;img src="http://home.images.mine/image.jpg" alt="image " title="image "&gt;&lt;/a&gt;';
ChildWindow=window.open("", "newwin");
ChildWindow.document.write(content);
ChildWindow.document.close();
}
//--&gt;
&lt;/script&gt;

&lt;/head&gt;
&lt;body&gt;
&lt;form action="#" id="postmodify" name="postmodify"&gt;
&lt;button type="text" onclick="OpenWin();"&gt;Smiley Window&lt;/button&gt;
&lt;textarea rows="5" cols="20" name="message"&gt;

&lt;/textarea&gt;
&lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;
Copy linkTweet thisAlerts:
@rlsajauthorOct 22.2004 — Fang Thank you so much it's working perfectly right now, even for my mozilla firefox users ?
×

Success!

Help @rlsaj spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.27,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...