Forum Moderators: coopster & phranque

Message Too Old, No Replies

Passing all contents of select menu

         

Drewser

2:31 pm on Jul 9, 2003 (gmt 0)

10+ Year Member



Right now, I have a javascript that dynamically creates a select menu which the user can edit and delete items from (javascript as well). I want to be able to store the entire contents of the select menu (selected items or not) as a perl variable of somesort in format that can be used to generate the entire selecte menu again for create/edit/delete purposes.

I am storing it in a html file, but the variables are stored just as text to be read with a cgi script to show the info again for modification.

I tried putting everything in a text box, but because of the nature of the data (many white spaces), it is nearly impossible to separate it out into the original select elements.

I'm sure exactly how to make this happen, any help would be greatly appreciated.

Here's some of the code:

CREATES THE SELECT MENU

<input type=button value="Add" onClick="move(this.form.fun,this.form.na,this.form.addapprovers,this.form.approvers)" name="C1">
<input TYPE=button value="Delete" onClick="remove(this.form.addapprovers,this.form.approvers)" name="C2">
<input TYPE=button value="Edit" onClick="edit(this.form.fun,this.form.na,this.form.addapprovers,this.form.approvers)" name="C3"><BR>
<select NAME="addapprovers" width=500 style="Width: 500px" size=5></select>
<input type=hidden name="approvers">

jatar_k

4:41 pm on Jul 10, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



but because of the nature of the data (many white spaces), it is nearly impossible to separate it out into the original select elements

Is there a way you could put a character between each element, such as a pipe ¦, and then maybe use split [perldoc.com] to chop it up into individual elements?