Today is . Page created 05/08/06, updated 05/23/06

Set TextArea In Form



A simple example of setting a textarea by clicking one of several buttons. You can pre-define the different answers and buttons according to the questions you need answered within your form. This saves your guests the time of thinking of the correct answer by having it already preset by selecting a certain button.

We have tested the code in IE6.0, Firefox1.5.0.2, Opera8.54, Netscape8.1 and AOL Explorer1.2. This script worked well in all platforms with no variations observed.

For Your Information For your Information:     Before we begin, we feel obligated to advise you that the above form is for all intensive purposes a "Stand Alone" script. In other words, it really does not do much of anything other than what you see. In order to make it function as designed, you need to incorporate it into a valid working form. If you do not have a good Solid Knowledge of HTML coding, javascripts, forms and reconfigurations, please "Do Not Attempt" this until you are Proficient in the aforementioned areas.

D epending on your knowledge of HTML and javascripts and forms, this is an easy one part copy and paste code that goes the <BODY> section of your document incorporated into a valid form. The reconfigurations are minimal, setting the colors, button names and messages.

Reconfigure Messages

<!-- 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,";

Y ou can add more, delete some or leave with the default number. If you add more, just follow the above sequence. If you add more, "Remember" to add another form button in another section of the code.

Reconfigure Textarea Form Box
</script><form id="form1" name="form1">
  <textarea name="Ira" cols="25" rows="5" id="ira" style="color: yellow; font-weight: bold; font-size: 18; background-color: brown">
This is how the default form will look.
  </textarea>

Just play around with the colors until it fits your site.

Reconfigure Buttons (Partial Code)

  <input type="button" value="Empty*" style="color: yellow; font-weight: bold; background-color: brown"
  onclick="javascript: document.form1.Ira.value = MessA[0];"> <input type="button" value="Set Mess1"
  style="color: yellow; font-weight: bold; background-color: brown"
  onclick="javascript: document.form1.Ira.value = MessA[1];"><input type="button" value="Set Mess2"
  style="color: yellow; font-weight: bold; background-color: brown"
  onclick="javascript: document.form1.Ira.value = MessA[2];">

* The button with the word "Empty" clears the form of any text from selecting any of the other buttons. We changed ours to the word "Clear".

The value="Set Mess1", 2 etc. is the text on the button itself. You can change that to whatever you need the buttons to say.

Y ou do not have to have the same color buttons as the form box if you don't want. Just experiment with it until it fits for you and your site. If you need to add more buttons for just follow the numerical sequence. "Remember", if you add more buttons, you must also add another message in another section of the code.

Warning Logo     Note Of Importance:     On the site you get the code, the code is not correct. We have notified them of this on 05/08/06. Until they rectify this little problem, you can get a good copy of the code here.
Get Good Copy Of Code Here ]

W e hope our tutorial was easy to follow and we covered everything in detail. If you would like to add this effect into your pages, grab the respective below link and you are there. If you have any problems with this or anything else, feel free to consult our FAQ ] and if you can't find the answer there, contact us ].
Get Code Here ]   [ Rate This Page ]  

Talk Live To A Support Technician

Search Our Site By Individual letter

A ]  [ B ]  [ C ]  [ D ]  [ E ]  [ F ]  [ G ]  [ H ]  [ I ]  [ J-K ]  [ L ] 
M ]  [ N-O ]  [ P-Q ]  [ R ]  [ S ]  [ T ]  [ U-V ]  [ W ]  [ X-Y-Z ] 

Little Tips Directory

Page 1  ] [ Page 2 ] [ Page 3 ] [ Page 4 ] [ Page 5  ] [ Page 6  ] [ Page 7  ]

Index Page 1 ] [ Index Page 2 ] [ Index Page 3 ] [ Index Page 4 ] [ Index Page 5 ]
Index Page 6 ] [ Index Page 7 ] [ Index Page 8 ] [ Index Page 9 ] [ Index Page 10 ]
Index Page 11 ] [ Index Page 12 ] [ Index Page 13 ]

News Letter Archives ] [ Navigation Page ] [ Archives Of Published Material ]
Link To Us ] [ Alphabet Index ] [ Feedback ] [ On Line Support ] [ FAQ ]
Webmaster Utilities ] [ Casino ] [ Banner Exchange ] [  Advanced Site Search ]

For Your Information For your Information:     If you notice in our above "Search Our Site!" form we have it sitting in an "I" Frame. Reason being is quite simple. There is a conflict between the drop down menu and our site search form. If they both sit on the same page when you go to search our site the page changes to instead of our database, it reverts back to this page.
So..... the "Workaround" is to place it in an "I" frame (have it open in a new window) and not be on this page. If you do not understand or need a little refresher on "I" Frames, grab the below link and you are there.
I Frames Explained ]

If you are part of the ever growing number of webmasters who enjoy sharing your knowledge with others on web design, join The Consigliere Ltd. web ring to broaden your scope of exposure.
Join Today

This Site Was Built And Is Maintained Exclusively by
The Webmaster @ Consigliere Ltd.

Copyright © Consigliere Ltd., All Rights Reserved. 2001-