How to send from one select option to another?
<p>(Possibly) simple jQuery question here. I'm using jQuery UI Dialog, and am putting a confirm into place. Basically, when a user selects a certain option (in combination with other circumstances), I want to be able to send them either back to the last select they had, or if I can't do that, a default one.</p>

<p>There is no "selected" attribute to the option either, which would have been my go-to example. Is there a way to do this? </p>

<p>Here is the js:</p>

<pre><code>alert('hey')
if (document.frm.notNull.checked == true) {
    // This is where it ends!
    if ($('input[name=valueTextField]').length &gt; 1) {
        $('#dialog p').empty();
        $('#dialog p').html("You're going to lose your stuff if you do this. You sure you want to?");
        $('#dialog').dialog({
            autoOpen: true,
            width: 600,
            modal: true,
            buttons: {
                "&lt;spring:message code='dialogBox.cancelConfirmation.YES'/&gt;": function() {
                    $(this).dialog("close");
                    $("#bottom").css('visibility', 'visible');
                    $('.edit-new').css('visibility', 'hidden');
                    $('.edit-trash').css('visibility', 'hidden');
                    // if table has more than one row, delete the rest.
                    deleteExtraRows('valueTable');
                    return true;

                },
                "&lt;spring:message code='dialogBox.cancelConfirmation.NO'/&gt;": function() {
                    $(this).dialog("close");

                    // Need to revert the user back to where they came from here.
                    $('#control[value=1]').attr('selected', true);
                    // return false;
                }
            }
        });
    } else {
        $("#bottom").css('visibility', 'visible');
        $('.edit-new').css('visibility', 'hidden');
        $('.edit-trash').css('visibility', 'hidden');
        // if table has more than one row, delete the rest.
        deleteExtraRows('valueTable');
        return true;

     }
 }​
</code></pre>

<p>And this is HTML (being rendered dynamically):</p>

<pre><code>&lt;div class="lbl"&gt;
    &lt;label&gt;Control&lt;/label&gt;
&lt;/div&gt;
&lt;select style="margin:0 0 0 8px; left:15px; position:relative;" name="control"
id="control" onChange="checkTableVisibility();"&gt;
    &lt;option value=1&gt;Check Box&lt;/option&gt;
    &lt;option value=0&gt;Dropdown Menu&lt;/option&gt;
    &lt;option value=3&gt;Radio Button&lt;/option&gt;
    &lt;option value=2 selected="selected"&gt;Text Box&lt;/option&gt;
&lt;/select&gt;
</code></pre>
