jQuery dropdown change function
<p>I want to create a function for the following:</p>

<pre><code>&lt;select name="journey_type"&gt;
&lt;option value="1"&gt;One Way&lt;/option&gt;
&lt;option value="2"&gt;Return&lt;/option&gt;
&lt;/select&gt;

&lt;div id="return_datetime_div" style="display:none;"&gt;
&lt;input id="Enquiry_return_datetime" type="text"&gt;
&lt;/div&gt;
</code></pre>

<p>The return_datetime_div is displayed when the user selects "Return". If the user then selects "One Way" the return_datetime_div gets hidden (this functionality is working):</p>

<pre><code>$("select[name='journey_type']").change(function()
{
    if($($(this)).val() == "2")
    {
        $("#return_datetime_div").slideDown();
    }
    else
    {
        $("#return_datetime_div").slideUp();
    }
}
});
</code></pre>

<p>Now I want to extend this for the following scenario:</p>

<ol>
<li>User selects "Return"</li>
<li>User enters some text in to #Enquiry_return_datetime</li>
<li>User then selects "One Way"</li>
<li>A 'confirm' popup should be displayed informing the user of the change of journey type</li>
<li>If the user accepts then the text in #Enquiry_return_datetime should be erased and the div gets hidden as per normal</li>
<li>If the user does not accept then the text remains AND the journey_type option should not change and div does not get hidden</li>
</ol>
