tart has asked for the wisdom of the Perl Monks concerning the following question:

Hi,
I am using CGI::Application and there is drop down list in my CGI form.
I have to populate another list by getting the value of drop down box.
So I implemented function in javascript for the onchange () event.
<select name="release" onchange="this.form.submit();"> <option value="<tmpl_var name=release>"> <tmpl_var name=release default='Select Release'></opti +on> <option value="1">1.0</option> <option value="2">2.0</option> <option value="3">3.0</option> <option value="4">4.0</option> </select>
Above code submit the form to the server but how can i send the selected option to server and how can I make perl capture that?
so that I can use that value in sql query to populate another list??

Thanks,
tart

Replies are listed 'Best First'.
Re: CGI Dropdown submit form and value
by GrandFather (Saint) on Jan 28, 2011 at 06:16 UTC

    You have three main options:

    1. Old school CGI - use an 'update' button to trigger a submit (or do that with a javascript on select handler) to refresh the dependent list
    2. Do it all in javascript - send all the possible values for the dependent list and select an appropriate set client side in the on select handler
    3. Use Ajax to just update the dependent list from the server
    True laziness is hard work