473,414 Members | 1,674 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,414 software developers and data experts.

javascript solution for building a string from items clicked in a list

Hello
I have been using php to extract data from a database. Some of the data is
put into a list on a web page. I wish users to click an item in the list
which is then copied into a text field. This can be repeated a number of
times, each time the item selected is added to the end ofthe string in the
text field. I understand javascript is the best approach to do this.can
anyone give me ideas about how to do this or if you know a solution already

Thanks
Ian
Jun 21 '06 #1
2 1185
Ian Davies said the following on 6/21/2006 2:39 PM:
Hello
I have been using php to extract data from a database. Some of the data is
put into a list on a web page. I wish users to click an item in the list
which is then copied into a text field. This can be repeated a number of
times, each time the item selected is added to the end ofthe string in the
text field. I understand javascript is the best approach to do this.can
anyone give me ideas about how to do this or if you know a solution already


And what happens if the user clicks something twice? Does it get added
twice or removed?

<select onchange="this.form.textAreaName.value += this.value">

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Jun 21 '06 #2
hi
thanks for your response

it will get added twice

ian

"Randy Webb" <Hi************@aol.com> wrote in message
news:e4******************************@comcast.com. ..
Ian Davies said the following on 6/21/2006 2:39 PM:
Hello
I have been using php to extract data from a database. Some of the data is put into a list on a web page. I wish users to click an item in the list
which is then copied into a text field. This can be repeated a number of
times, each time the item selected is added to the end ofthe string in the text field. I understand javascript is the best approach to do this.can
anyone give me ideas about how to do this or if you know a solution
already
And what happens if the user clicks something twice? Does it get added
twice or removed?

<select onchange="this.form.textAreaName.value += this.value">

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices -

http://www.JavascriptToolbox.com/bestpractices/
Jun 21 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Jackson Yap | last post by:
can someone kind enough to help me look at the attached html and js file? Why is it that the javascript menu could not work at www.apchosting.net but could work at...
1
by: Jackson Yap | last post by:
can someone kind enough to help me look at the attached html and js file? Why is it that the javascript menu could not work at www.apchosting.net but could work at...
24
by: Aaron Gray | last post by:
From what I have been looking at for Javascript library development, browsers that support Javascript 1.5/ECMAScript 3/JScript 5.5 looks like the base level to pitch at. Anyone add anything ? ...
3
by: bnsmith001 | last post by:
I have a text file with 29766 words in it. Currently, the file is formatted with one word per line, followed by a DOS CR/LF. I'd like to write a Word-of-the-Day tool solely in javascript, where 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
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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.