Beefy Boxes and Bandwidth Generously Provided by pair Networks DiBona
laziness, impatience, and hubris
 
PerlMonks  

Re: Getting all values from a CGI list box

by rashley (Scribe)
on Jan 03, 2007 at 08:46 UTC ( [id://592758]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to Getting all values from a CGI list box

Well, I got it working. I ended up making my own serialize function in J/S.

Just in case anyone needs it, here's what I did.

On the server:

my @selected = map { uri_unescape($_) }split(/,/, $cgi->param($attr));

On the client:

document.getElementById("Finish Codes").value = serialize(document.get +ElementById("Finish Codes rightbox").options); document.getElementById("Process Codes").value = serialize(document.ge +tElementById("Process Codes rightbox").options); . . . function serialize(list) { var encodedlist = new Array(list.length); for (var i = 0; i != list.length; i++) { encodeURIComponent(list[i].value); encodedlist.push(list[i].value); } return encodedlist.join(","); }

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://592758]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.