title: use jquery dialog input after clicking ok on jquery dialog
body: <p>i  want to use user input in jquery dialog input box to be used when jquery dialog ok button is pressed.</p>
  
  <p>now the problem is the code after jquery dialog box also get executed withought waiting for jquery input field to be filled by user</p>
  
  <pre><code>&lt;p id="text"&gt; click me &lt;/p&gt;
  &lt;div id="test" class="sandy" &gt; 
      &lt;input id="username" class="sandy1" /&gt;
  &lt;/div&gt;​
  
  $('#text').click(function(){
      $('.sandy').dialog({ 
       buttons: { 
      "OK": function() { 
       $(this).dialog('close'); 
      }}
      });
      var myvalue= $("#test").val();
      alert(myvalue);
  })
  </code></pre>
  
  <p>you can check the demo at this <a href="http://jsfiddle.net/zCFD5/88/" rel="nofollow">link</a> : <a href="http://jsfiddle.net/zCFD5/86/" rel="nofollow">http://jsfiddle.net/zCFD5/86/</a></p>
  
  <p>please suggest me some way out to hold on to jquery dialog till user presses ok button and then move on to code after it.</p>