title: passing parameters to jquery ui dialog
body: <p>I use <code>.data</code> like this to pass the id of the textbox that calls the dialog</p>
  
  <pre><code>$("#&lt;%=txtDirProprio.ClientID%&gt;").focus(function() 
  {
           $("#&lt;%=dialog.ClientID%&gt;").dialog( "open" ).data("id","#&lt;%=txtDirProprio.ClientID%&gt;");
           return false;
  });
  </code></pre>
  
  <p>here is the code for the dialog</p>
  
  <pre><code> $("#&lt;%=dialog.ClientID%&gt;").dialog({
                  autoOpen: false,
                  show: "blind",
                  hide: "explode",
                  width: 800,
                  height:200,
                  modal: true,
                  buttons: 
                  {
                      "Ajouter": function() {
                          $( this ).dialog( "close" );
                          StringBuilderDir($( this ).data("id"));
                      },
                      "Vider": function() {
                          $( this ).dialog( "close" );
                          $( $( this ).data("id") ).val("")
                      },
                      "Canceler": function() {
                          $( this ).dialog( "close" );
                      }
                  },
                  open: function() 
                  { 
                      var dir = $( $( this ).data("id") ).val().split("-");
                      if(dir[0] != "")
                      {
                          $("#&lt;%=dd_dialog_directionvp.ClientID%&gt; option").each(function(index) 
                          {
                              if ($("#&lt;%=dd_dialog_directionvp.ClientID()%&gt; option")[index].text == dir[0]) 
                              {
                                  $("#&lt;%=dd_dialog_directionvp.ClientID()%&gt;  option")[index].selected = true;
                              }
                          })
                       }
                   }
                   });
  </code></pre>
  
  <p>So <code>$  ( this ).data("id")</code> returns the id of the textbox. It works fine except in the open function. The id is undefined</p>
  
  <p>Why it works in the functions for the buttons but not in the open function. It looks like it's not the same 'this'</p>
  
  <p>Thank you</p>