[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [help-cgicc] Multiple selection boxes
From: |
Stephen F. Booth |
Subject: |
Re: [help-cgicc] Multiple selection boxes |
Date: |
Mon, 11 Jul 2005 18:29:55 -0700 |
User-agent: |
KMail/1.8.1 |
You want to grab all the FormEntry objects that you want using an iterator and
access your objects that way:
std::vector<cgicc::FormEntry> user_selections;
if(false == user_selections.empty()) {
for(std::string::size_type i = 0; i < user_selections.size(); ++i) {
std::cout << user_selections[i].getValue();
}
}
else {
// Nothing selected, maybe print an error message
}
If you don't care if the submission is emtpy obviously the code would be
simpler.
Stephen
On Friday 08 July 2005 08:15, Alverth, Daniel C wrote:
> Hello,
> My name is Dan Alverth and I'm using Cgicc. I have a dilemma.
>
> I construct a select object as follows:
> cgicc::select( ).set("name","Control Variables
> Box").set("size","10").set("multiple");
>
> I get the submitted form data as follows:
> cgicc::Cgicc.getElement("Control Variables Box") -> getValue( );
>
> But this only returns a single string (The first selected entry
> only).
> I lose all the other selections.
> If the user selected 5 entries, getValue( ) only returns the first
> selection.
>
> Is there a way to correct this problem?
>
> Thank you very much.
>
> Dan Alverth
> Associate Programmer
> Nielsen Media Research
> 150 N. Martingale rd.
> Schaumburg, IL 60173-2076
pgpRe2vDOleJE.pgp
Description: PGP signature