jQuery - cancel change event on confirmation dialog for a Dropdown
<p>I have a dropdown and I have the <code>jQuery</code> "change" function.</p>

<p>I would like to implement the change of the selected item as per the Confirmation dialog.</p>

<p>If confirms true i can proceed for selected change otherwise I have keep the existing item as selected and cancel the change event.</p>

<p>How can I implement this with jQuery ...????</p>

<p>jquery Function </p>

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

        $("#dropdown").change(function () {

               var success = confirm('Are you sure want to change the Dropdown ????');

                    if (success == true) {
                        alert('Changed');  

// do something                  
                     }
                    else {

                        alert('Not changed');

                       // Cancel the change event and keep the selected element
                     }
        });
    });

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

<p>NB: One thing to remember "change" function hits only after selected item changed
So better to think to implement this on "onchange" - but it is not available in jquery and Is there any method to implement this ????</p>

<p>Any help will be appreciated...</p>

<p>Vinu</p>
