/    Sign up×
Community /Pin to ProfileBookmark

Insert into text area

Hi,

I’m really new to web work so please bare with me.

I have a text area and need to insert text into it when a user presses a button. It needs to work exactly like the ‘insert link’ option on this website, where a pop up opens allowing the user to enter text, which is then inserted along with the bbcode to turn it into a link.

If anyone can point me in the right direction that would be great.

Thank you

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@mrhooDec 10.2006 — buttonref.onclick=function(textarearef.value='some text'};
Copy linkTweet thisAlerts:
@KorDec 10.2006 — buttonref.onclick=function(textarearef.value='some text'};[/QUOTE]
grandad looks like a beginner so that it might not understand what buttonref or textarearef might be.

<i>
</i>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt;
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;Untitled Document&lt;/title&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"&gt;
&lt;meta http-equiv="Content-Style-Type" content="text/css"&gt;
&lt;meta http-equiv="Content-Script-Type" content="text/javascript"&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;form&gt;
&lt;input type="button" value="Insert text" onclick="this.form['myTextarea'].value='Lorem ipsum'"&gt;
&lt;br&gt;
&lt;br&gt;
&lt;textarea name="myTextarea"&gt;&lt;/textarea&gt;
&lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;
Copy linkTweet thisAlerts:
@mrhooDec 10.2006 — Good point, Kor.
×

Success!

Help @grandad 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.9,
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,
)...