in jQuery, is it possible to halt execution until a user submits a value in a jQuery UI dialog?
<p>Currently, I have an event handler for   <code>$('.toggle-enable-item').click(functi ....</code>  which does an ajax request and a set of associated callbacks. I would like to just add one for   <code>$('.toggle-enable-menu-item .with-comment').click(fun...</code> and set the textarea for that comment to a window.unenable_comment. </p>

<p>However, the event for .with-comment just proceeds through. Is there a way to tell Javascript to halt execution until the user clicks the button for 'Add Comment Item'? Ideally, I'd like this to cascade into the 'toggle-enable-item'. FWIW, the prompt call seems to halt execution correctly.</p>

<p>Is this happening because the event is being bubbled up? Is there a way I can prevent this bubbling and just make the ajax call separately?</p>

<p>non-enabled:</p>

<pre><code>&lt;li data-id="1709" data-status="not-enabled" class="toggle-enable-item"&gt;enable&lt;/li&gt;
</code></pre>

<p>enabled:</p>

<pre><code>&lt;li class="toggle-enable-item" data-id="1710" data-status="enabled"&gt;
unenable
&lt;span class="with-comment"&gt;with comment&lt;/span&gt;
&lt;/li&gt;
</code></pre>

<p>thx</p>
