Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

move text from one text area to another

Status
Not open for further replies.

Tracey

Programmer
Oct 16, 2000
690
NZ
Hi..

I was wondering if it is possible to emulate "pick-boxes" (if that is what u call them... much like the field selector interface in crystal reports) where values displayed from a Database are displayed in one, with selection arrow buttons provided for the user to select one or more of these values and move them into the second box. (Allowing a multiple selection.. instead of using check-boxes)

If anyone out there understands what all that garble means, and can help, i would appreciate your advice.


:-s thx in advance
 
Well.. close yes. I found this script which is EXACTLY what i want..

however no contentfields seem to be passed for the "selected" (list2) items.

I am dynamically filling the first list with values from a database and need to pick up those values at the "post" action. Can anyone tell me a little more about this code, ie how to pick up the values held in this list?

cheers
s-)
 
Hi, here's a bit of help on the script...

Code:
for (i = 0; i < tbox.options.length; i++) {
arrLookup[tbox.options[i].text] = tbox.options[i].value;
arrTbox[i] = tbox.options[i].text;
}
[ignore]
To get the &quot;value&quot;(ie. 12) --> tbox.options.value

to get the &quot;text&quot;(ie. Alabama)--> tbox.options.text

where is the rank it's at...
ie. tbox.options[0].text will return Alabama
tbox.options[1].text will return Alaska and so on...
[/ignore]
So if you want to cycle thru all of the &quot;options&quot; you'll need the FOR

for (i = 0; i < tbox.options.length; i++) where tbox.options.length is the total number of options.

If you need more on it, just say it.



Have Fun...

Sharky99 >:):O>
 
ok.. code that i have i understand.

once the user selects items and moves them to box2, (and has completed the rest of the form) he/she will hit the submit button.

this will call another action (post) which checks and saves the data via Request values.

My problem now is that no Request values seem to be passed for these boxes. I would have thought they would.
 
Seems to me that to fix this problem i need to automatically ensure that all items moved to box2 are always &quot;selected&quot; so the values are passed.

i will also need to pass some sort of &quot;count&quot; value so i can loop through the selected values at the post action.

sheesh.. at this point i wish i could use check-boxes but there will be too many records.. :-I
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top