Writing back to the input field, which started function

Writing back to the input field, which started function

Hi,
i'm a newbie, so hopefully this is an very easy to answer question.
I have couple of input field which should be linked to open an jQueryUI dialog box. The point is, how can I archieve that the function writes back to the input field from which the dialog was started?
Using (this) only effects the dialog box.


  1.     // this is the click event for the input-field class called "link"
  2.     $('.link')
  3.         .button()
  4.         .click(function() {
  5.             $('#dialog-form').dialog('open');
  6.         
  7.         });  
  8.    
  9.     //this is an excerpt from the opened dialog box and the write back to the input field
  10.     $("#dialog-form").dialog({
  11.                     if (bValid) {
  12.                         $('.link').val('<a href="' +
  13.                             adress.val() + '">' +
  14.                             name.val() + '</a>');
  15.                         $(this).dialog('close');
  16.                     }
  17.    });






    • Topic Participants

    • nkolb