n8w Posted March 28, 2006 Share Posted March 28, 2006 javascript insert into textarea questioncan 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 stepsfor 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 areathanksn8w Link to comment https://forums.phpfreaks.com/topic/6049-javascript-insert-into-textarea-question/ Share on other sites More sharing options...
GBS Posted April 19, 2006 Share Posted April 19, 2006 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 firefoxdocument.getElementById('my_text_area').value="";// & to hide the textarea partdocument.getElementById('my_text_area').style.visibility="hidden";</script></body></html>[/code]Hoping it will help,,l8tr,, Link to comment https://forums.phpfreaks.com/topic/6049-javascript-insert-into-textarea-question/#findComment-28769 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.