lanta has asked for the wisdom of the Perl Monks concerning the following question:
I have a web input form and the form has a SELECT input element. I'm using the CGI module to get the values selected in the SELECT element.
@selected_options = $cgi->param( 'select_name' );
@selected_options would typically contain the values of selected options( like 1,2,3 etc ). I'm getting the string "[ object HTMLInputElement ]", which I guess is the stringified Option object.
I should mention that the SELECT options have been dynamically added using the following Javascript function.
function addOption(object,text,value) { var optionName = new Option(text, value) object.options[object.length] = optionName; object.options[object.length-1].selected = false; }
Is it possible to add the option in a different fashion so that param would return the value or is there a different way to use param() to get the value from the Option object.
Thanks in advance for your time.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: CGI param returns HTMLInputElement.
by aquarium (Curate) on Oct 01, 2007 at 03:28 UTC | |
|
Re: CGI param returns HTMLInputElement.
by Gangabass (Vicar) on Oct 01, 2007 at 01:27 UTC | |
by lanta (Sexton) on Oct 02, 2007 at 11:47 UTC | |
|
Re: CGI param returns HTMLInputElement.
by balaji_red83 (Acolyte) on Oct 01, 2007 at 06:51 UTC | |
by lanta (Sexton) on Oct 02, 2007 at 11:53 UTC | |
|
Re: CGI param returns HTMLInputElement.
by stark (Pilgrim) on Oct 01, 2007 at 11:16 UTC | |
by holli (Abbot) on Oct 01, 2007 at 12:07 UTC | |
by lanta (Sexton) on Oct 02, 2007 at 11:56 UTC | |
|
Re: CGI param returns HTMLInputElement.
by Anonymous Monk on Oct 01, 2007 at 03:24 UTC | |
by lanta (Sexton) on Oct 02, 2007 at 11:48 UTC |