faqts : Computers : Programming : Languages : JavaScript : Forms : TextAreas/TextFields

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

29 of 69 people (42%) answered Yes
Recently 3 of 10 people (30%) answered Yes

Entry

How do I insert text inputted from a javascript prompt into the text within a text area?

Jan 3rd, 2002 08:16
Arsen Yeremin, Fred,


<html>
<head>
	<title>Prompt to TextArea</title>
</head>
<script>
function AskName()
{ var obj_text = document.my_form.my_text;
  obj_text.value = prompt("What is your name?","Arsen Yeremin")
}
</script>
<body onload="AskName()">
<form name="my_form">
  <textarea name="my_text"></textarea>
</form>
</body>
</html>