»
EnglishFrenchVietnamese

Print - Set TextArea - JavaScriptBank.com

Full version: jsB@nk » Form » Textarea » Set TextArea
URL: https://www.javascriptbank.com/set-textarea.html

Set TextArea © JavaScriptBank.comA simple example of setting a textarea by clicking one of several buttons.

Full version: jsB@nk » Form » Textarea » Set TextArea
URL: https://www.javascriptbank.com/set-textarea.html



JavaScript
<SCRIPT language=javascript><!-- Original Programmed by Ira Sterbakov - [email protected] 8/5/05 --><!-- PLease keep credit in JavaScript section --><!-- May be freely used and modified - email notification would be nice -->var MessA = new Array()MessA[0] = " ";var rDe = 0;rDe++;MessA[rDe] = "This is the first message that you want to post in the text area,";rDe++;MessA[rDe] = "This is the second message that you want to post in the text area,";rDe++;MessA[rDe] = "This is the third message that you want to post in the text area,";rDe++;MessA[rDe] = "This is the fourth message that you want to post in the text area,";rDe++;MessA[rDe] = "This is the fifth message that you want to post in the text area,";</SCRIPT><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->


HTML
<FORM id=form1 name=form1><P><TEXTAREA id=ira style="FONT-WEIGHT: bold; FONT-SIZE: 18px; COLOR: yellow; BACKGROUND-COLOR: brown" name=Ira rows=5 cols=25></TEXTAREA><BR><BR><INPUT style="FONT-WEIGHT: bold; COLOR: yellow; BACKGROUND-COLOR: brown" onclick="javascript: document.form1.Ira.value = MessA[0];" type=button value=Empty> <INPUT style="FONT-WEIGHT: bold; COLOR: yellow; BACKGROUND-COLOR: brown" onclick="javascript: document.form1.Ira.value = MessA[1];" type=button value="Set Mess1"><INPUT style="FONT-WEIGHT: bold; COLOR: yellow; BACKGROUND-COLOR: brown" onclick="javascript: document.form1.Ira.value = MessA[2];" type=button value="Set Mess2"><INPUT style="FONT-WEIGHT: bold; COLOR: yellow; BACKGROUND-COLOR: brown" onclick="javascript: document.form1.Ira.value = MessA[3];" type=button value="Set Mess3"><INPUT style="FONT-WEIGHT: bold; COLOR: yellow; BACKGROUND-COLOR: brown" onclick="javascript: document.form1.Ira.value = MessA[4];" type=button value="Set Mess4"><INPUT style="FONT-WEIGHT: bold; COLOR: yellow; BACKGROUND-COLOR: brown" onclick="javascript: document.form1.Ira.value = MessA[5];" type=button value="Set Mess5"> </P></FORM><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->