Jump to content

javascript insert into textarea question


n8w

Recommended Posts

javascript insert into textarea question
can anyone tell me or point me to some information for the following:

I want to create a javascript function that inserts text into the textarea of a form .. which is easy .. but how do I create it for a series of steps

for example ...

I want it to work just like the insert link for this editor .. where you click insert link .. it asks for the link .. then the name of the link and then inserts the code into the text area

thanks
n8w
Link to comment
Share on other sites

  • 3 weeks later...
Hi there,

If I get it,, maybe something like that could help you,
[code]
<html>
<script>
function DoTheJob()
{    
    var message = "Waiting for some values,,";
    var return_value = prompt(message,"");

document.getElementById('my_text_area').value=return_value;
document.getElementById('my_text_area').style.visibility="visible";
}
</script>

<body>

<input type="button" value="Hello the world" onclick="DoTheJob()">

<textarea rows="2" cols="20"  id="my_text_area"></textarea>

<script>
// just to init the old values for firefox
document.getElementById('my_text_area').value="";
// & to hide the textarea part
document.getElementById('my_text_area').style.visibility="hidden";
</script>

</body>
</html>

[/code]

Hoping it will help,,

l8tr,,
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.