Passing form data through js/jquery
<p>I have the following code which when div clicked converts the div into a dropdown - works perfectly, however, I have "on change" set to submit the form and it passes all data apart from the option selected in the dropdown/select element, any ideas?</p>

<p>This is the js</p>

<pre><code>&lt;script type="text/javascript"&gt;
    $(document).ready(function(){

        var choices = "&lt;select class='choices_dropdown' name='list_name' onchange=\"this.form.submit();\"&gt;"+"&lt;option value='My list'&gt;My list&lt;/option&gt;"

        &lt;?php
        // this loads the select element    
            $wishes4 = mysql_query("select event_id from user_events where user_id = '$userfromcookie'",$db);

            while ($databack444 = mysql_fetch_array($wishes4)) { // cc
            $wishes5 = mysql_query("select event from events_master where event_id = '$databack444[event_id]'",$db);

            $databack555 = mysql_fetch_array($wishes5);

            echo "+\"&lt;option value='".$databack555[event]."'&gt;".$databack555[event]."&lt;/option&gt;\"";

            } // close CC
        ?&gt;

        +"&lt;/select&gt;";

        $(".update").click(function() {
            var $this = $(this),
            currentChoice;
            // don't continue if there's already a select in this cell
            if ($this.find("select").length != 0)
                return;
            currentChoice = $this.html();
            var $choices = $(choices);
            $this.empty().append($choices);
            $choices.val(currentChoice);
        });

        $(document).on("change", ".choices_dropdown", function() {
            var $this = $(this);
            $this.parent().html($this.val());
            $('#event_update').submit(); /* this submits the form */
            return false;
        });

    });
&lt;/script&gt;
</code></pre>

<p>and the html which displays the div is:</p>

<pre><code>echo '&lt;td class="update"&gt;
&lt;form action=/list2.html method=post id=event_update&gt;'
.$databack33[list_name].
'&lt;input type="hidden" name="wishlist_id" value='
.$databack33[list_id].
'&gt;
&lt;input type="hidden" name="action" value="update_list"&gt;
&lt;/form&gt;&lt;/td&gt;';
</code></pre>
