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.
- // this is the click event for the input-field class called "link"
- $('.link')
- .button()
- .click(function() {
- $('#dialog-form').dialog('open');
-
- });
-
- //this is an excerpt from the opened dialog box and the write back to the input field
- $("#dialog-form").dialog({
- if (bValid) {
- $('.link').val('<a href="' +
- adress.val() + '">' +
- name.val() + '</a>');
- $(this).dialog('close');
- }
- });