Re: [Cppcms-users] get selected value of cppcms::widgets::select
Brought to you by:
artyom-beilis
|
From: Lee E. <le...@el...> - 2013-06-19 04:10:00
|
you have a problem with your HTML since your option is like this: <option value="2">two</option> the text "two" is used as label - and the browser will NOT send it back to the server, insead it will send the value "2" if you want the value sent from the server to be something else - place whatever you want on the value attribute of the option On Tue, Jun 11, 2013 at 7:52 PM, ccppprogrammer <ccp...@gm...>wrote: > ... small typo in sample html element: > <select name="test"> > <option value="1">one</option> > <option value="2" selected>two</option> > </select> > > So I need method to get value "two" from test widget. > > > On Tue, Jun 11, 2013 at 8:28 PM, ccppprogrammer <ccp...@gm...>wrote: > >> Dear All! >> >> I didn't find method to get selected value of cppcms::widgets::select. >> I need method to get value "two" from test widget. >> Unfortunately selected() method returns integer index of the list not >> value. >> >> http://cppcms.com/cppcms_ref/1.0.2/classcppcms_1_1widgets_1_1select__base.html >> >> <select name="test"> >> <option value="one">1</option> >> <option value="two" selected>2</option> >> </select> >> >> Thanks in advance! >> >> > > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by Windows: > > Build for Windows Store. > > http://p.sf.net/sfu/windows-dev2dev > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > > |