title: Getting Data from JSON into TextBoxes in jQuery UI Dialogs
body: <p>I will try to explain my situation here as much as possible. Since it's a work related issue I don't have much code to show.</p>
  
  <p>I am working with a jQuery dialog. Scenario is, I got a list of some names per say &amp; there's a bootstrap dropdown in front of each name. To be more specific, I am trying to make a edit window, by which user can edit the record . The names are coming from a JSON fetched from PHP based backend. </p>
  
  <p>We all know that we can easily get data &amp; manipulate it using <code>$.get</code> right? In the same block, I wrote the code for jQuery UI Dialog like this,</p>
  
  <pre><code>//document.ready block
  $.get( "ajax/test.html", function( data ) {
    $( ".result" ).html( data );
   $("#btn-edit").on('click', function(){
      $( "#dialog" ).dialog({
        open: function(){
  
           $('#some_textbox').val(data.name); //textbox is in the dialog
        }
      });
   });
  });
  
  &lt;div id="dialog" title="Basic dialog"&gt;
   &lt;p&gt;This is the default dialog which is useful for displaying information. The dialog  window can be moved, resized and closed with the 'x' icon.&lt;/p&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>The issue was that the textbox's value was not getting set to <code>data.name</code> whereas I could perfectly <code>console.log(data);</code> in that block. I was able to set some random string like this too, <code>$('#some_textbox').val("some random string");</code>.</p>
  
  <p>Why?</p>
  
  <p>So my mentor aka supervisor told me that, it has to do something with bindings. Is it true? How could I possibly solve this?</p>