473,409 Members | 1,943 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,409 software developers and data experts.

List of options for textarea using javascript

I have a need to create a list in a textarea, some selected by clicking on a word, some typed in by user. I have tried many things to little avail. I can set the text in the texarea, but it will not create a list nor add new items to the list. Anyone got any ideas?
Dec 20 '05 #1
7 13837
Niheel
2,460 Expert Mod 2GB
Can you show us a link to an example form that uses what you want? I am not sure what you mean by list in a text area?
Dec 20 '05 #2
I haven't found one. I am thinking it might can be done using javascript, simulating writing to the textarea.
Basically, I will have a table with a textarea in one cell, and single word selections in the other cells whose values can be added to the textarea if the user clicks on it.
If they do not like the selections, they have the option to type in other single words of their own choosing at the bottom of the textarea.
Dec 20 '05 #3
Niheel
2,460 Expert Mod 2GB
haha, ah yes . . that is doable. You got me worried for a sec. I thought is this person asking to have a list inside the text area.

A good example of this is right in the forms of thescripts.com If you click on "Go Advanced" button in the quick reply form you will notice a bunch of smiley's and link buttons around the box. If you click on one, it will add stuff to the text area.

You are right you will need to use javascript.

Here is a good tutorial to start out, it might not do exactly what you want but the concept it very similar. The information might help you figure it out.

Add text to textarea or text field
Dec 21 '05 #4
Thanks for your response. Actually, you had it right the first time, though. I am trying to create a list in a text area. I saw your example early in the search and it might work, but they also want to be able to choose from a visual table some set terms, as well as write some terms. It is kind of a hybrid selection and textarea box.

I may need to go with the example you have provided as it may be another user "unicorn" that would fly like a stone anyway, but I thought I would try.



haha, ah yes . . that is doable. You got me worried for a sec. I thought is this person asking to have a list inside the text area.

A good example of this is right in the forms of thescripts.com If you click on "Go Advanced" button in the quick reply form you will notice a bunch of smiley's and link buttons around the box. If you click on one, it will add stuff to the text area.

You are right you will need to use javascript.

Here is a good tutorial to start out, it might not do exactly what you want but the concept it very similar. The information might help you figure it out.

Add text to textarea or text field
Dec 21 '05 #5
:p
Hey, you are right, the one with the emoticons does just what I need it to do!
I was looking at the selection box you have on another page.
How is that set up?

haha, ah yes . . that is doable. You got me worried for a sec. I thought is this person asking to have a list inside the text area.

A good example of this is right in the forms of thescripts.com If you click on "Go Advanced" button in the quick reply form you will notice a bunch of smiley's and link buttons around the box. If you click on one, it will add stuff to the text area.

You are right you will need to use javascript.

Here is a good tutorial to start out, it might not do exactly what you want but the concept it very similar. The information might help you figure it out.

Add text to textarea or text field
Dec 21 '05 #6
Niheel
2,460 Expert Mod 2GB
I believe it's an onclick event that adds the data to the form via javascript. So "OnClick" image of smiley, smiley text is added to text area form.

These are the keywords i would search for in google: onclick, textarea, javacsript.

Keep us updated on what kind of solutions you run into.
Dec 21 '05 #7
javascript:
Expand|Select|Wrap|Line Numbers
  1.  
  2. <script language="javascript" type="text/javascript">
  3. function addtext(newtext) { 
  4.     document.myform.mytextarea.value = document.myform.mytextarea.value+= newtext;
  5. }
  6. </script>
HTML: Down in a table of "talents, skills, hobbies"
Expand|Select|Wrap|Line Numbers
  1.  <form name="myform"> 
  2. <table ...>
  3. <textarea name="mytextarea" cols=25 rows=15><talents></textarea>
  4. ....
  5. <A href="javascript:addtext('Fishing\r');">4-H</A>
  6.  
THANK YOU!
Dec 21 '05 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: weiwei | last post by:
Hi all I want to write a asp script, basically, that has drop down box in the form, if user select Yes, on the same page, a hidden textarea will show up, if user select No, then nothing happen....
5
by: Andrew V. Romero | last post by:
At work we have an excel file that contains the list of medications and their corresponding strengths. I would like to save the excel file as a text list and paste this list into a javascript...
3
by: Gram | last post by:
Hello, Can anyone help me with the following, or point me to a site that can help: I have a list of words in a List and I want a user to be able to select several words from this list, hit a...
1
by: bin_P19 P | last post by:
the code i have got is as follows and now im stuck <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>Shopping...
4
by: just1coder | last post by:
Is it possible to create a dropdown list populated by the contents of a textarea? <textarea> <a name="this">this</a> <a name="that">that</a> </textarea> Then, the dropdown would have the <a>...
2
by: Craig | last post by:
How can I have a user select an option in a list (<SELECT>) and click an 'Add' button. The selected options 'Value' will then be added to the cursor position in a TextArea box.
4
by: devine | last post by:
Hi All, I am VERY new to Javascript. I have been provided with some code, which will enable me to hide/show a text area and change a submit button dependant on a check box. <!DOCTYPE html...
7
by: kirke | last post by:
Hi. I want to make a list of days between two days. How can I make it??? Thx.
3
by: Italio Novuas | last post by:
Hi all, let me begin by saying that I *ALMOST* have this complete! What I'm trying to do is make it so my text area shows the innerHTML of any select item with the same value. For example, if I...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.