Chris.Stover
Chris.Stover

Reputation: 514

Submitting drop down box input with submit button

I feel bad about asking this but I haven't been able to find the solution on SO or google.

I need to capture the input in multiple drop down boxes on a webpage. I have the page created and I have incorporated a submit button. When I click submit the only information that is submitted comes from the text boxes and clickable buttons.

This code will submit from the button

<div id="selectionButtons"><!-- allows the user to select between veto and issue-->
    <input type="radio" name="searchType" value="issue" checked>Issues<br>
    <input type="radio" name="searchType" value="veto">Vetos
</div>

This code will also cause the info to be submitted

<div class="listbox" id="orgCode" style="padding-right:10%">
        <label for="orgCode">Organization Code</label>
        <select size="10" name="org" class="box" style="width:100%;" 
        multiple="true">
            <option selected>Code 1
            <option>Code 2
            <option>Code 3
            <option>Code 4
            <option>Code 5
            <option>Code 6
        </select>
</div>

But this code will not submit the information in the text box

<div class="ui-widget" id="fiscalYear">
        <label for="fiscalYear">Fiscal Year</label>
        <select id="fisc">
            <option value="">Select one...</option>
            <option value="1">first</option>
            <option value="2">second</option>
            <option value="3">third</option>
            <option value="4">fourth</option>
            <option value="5">fifth</option>
            <option value="6">sixth</option>
            <option value="7">seventh</option>
            <option value="8">eight</option>
            <option value="9">ninth</option>
            <option value="10">tenth</option>
        </select>
        <script>
            $(function() {
                $( "#fisc" ).combobox();
                $( "#toggle" ).click(function() {
                    $( "#fisc" ).toggle();
                });
            });
        </script>

At first I thought the problem was my implementation of the jQuery combobox so I went to a plain select option drop down. That didn't solve the problem so I thought that maybe it was being caused by the ending option tag.

Any help would be greatly appreciated, this is my first experience with html and javascript/css

Upvotes: 0

Views: 4793

Answers (1)

mikey
mikey

Reputation: 5160

You must give your select tag a name, not just an id

<select id="fisc" name="fisc">

Upvotes: 3

Related Questions