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

Data from select box to formbox a.l.a Hotmail, yahoo etc

hey there

for my website, i am trying to create a messaging system and so far am
nearly finished, except for one thing. I am not sure how i can get
data from a select form box into a normal data box, and then seperate
them with a "," after every one.

_____________________ __________
To:|s*@hotmail.com,ooo@..|<---- |sh@hotma..|
|ooo@hotm..|
|qpr@hotm..|
|1121@hot..|
|__________|

lol if that diagram made ANY sense.

any help would be much appreciated, as i am pretty much tearing my
hair out now.

Many thanks,
Jack Bastow
(a55m0nk)
Jul 20 '05 #1
1 2705
-[ CaMeL ]- a55m0nk wrote:
I am not sure how i can get
data from a select form box into a normal data box, and then seperate
them with a "," after every one.


Well, just iterate thorugh the options of your select box, buffer their
value and output the buffer into the text box. An example follows.
<form action="foo">
<select name="a">
<option value="Lu***@grandline.com">Luffy</option>
<option value="Zo***@grandline.com">Zorro</option>
<option value="Na**@grandline.com">Nami</option>
</select>

<input type="button"
value="&gt;&gt;"
onclick="transform(
this.form.elements['a'],
this.form.elements['b']);">

<input type="text" name="b">
</form>

<script type="text/javascript">
function transform(src, dest){
var a=[];
for(var ii=0; ii<src.options.length; ii++)
a[ii]=src.options[ii].value;
dest.value=a.join(",");
}
</script>
---
The following, while much more attractive, unfortunately doesn't work in
IE (but is fine in Mozilla).

Option.prototype.toString=function(){
return this.value;
}

function transform(src, dest){
dest.value=Array.prototype.join.call(src.options);
}
---
HTH
Yep.
Jul 20 '05 #2

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

Similar topics

6
by: Michael | last post by:
I have two tables with a 1-many relationship. I want to write a select statement that looks in the table w/many records and compares it to the records in the primary table to see if there are any...
5
by: TC | last post by:
Hello, I am familiar with obtaining source file reference material from the system clipboard using the old Win32 API. For example, copy an Excel chart onto the clipboard and goto Word. Under,...
3
by: captain | last post by:
Below is the sql for data with same date need to extract + or - 5 days data of same date also. How to also get data of + and - days related to same date. SELECT IM.Area, IM.Location,...
4
by: MikeY | last post by:
Hi everyone, I have posted earlier this week, but I'm still scratching my head trying to figure out how to change/modify my data back to my db. Using C# Windows forms. I am trying to learn how...
9
by: VMI | last post by:
We have this huge application that's based on storing tons of data on a dataTable. The only problem we're having is that storing LOTS of data (1 million records) into a datatable will slow down the...
3
by: Shelby Cain | last post by:
The select statements return different data for most_commons_vals depending on whether n_distinct is included in the select clause or not. I only seem to get the behavior below against int8...
1
by: jrs_14618 | last post by:
Hello All, This post is essentially a reply a previous post/thread here on this mailing.database.myodbc group titled: MySQL 4.0, FULL-TEXT Indexing and Search Arabic Data, Unicode I was...
9
by: a | last post by:
Dear friends I want import data from CSV file to mdb file How can I do that in vb.net?
25
by: bonneylake | last post by:
Hey Everyone, Well i am not sure if my question needs to be here or in coldfusion. If i have my question is in the wrong section i am sorry in advance an will move it to the correct section. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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.