Access dialogs' buttons

Access dialogs' buttons

Hi everyone!

I started to study JQuery a week ago, so i'm still a beginner.
I have a difficulty: how to get access to JQuery buttons, which are located inside JQuery dialog? Here is the code of initializing the last one:
  1. function initDialog()
  2. {
  3.       var enterLabel = "Log in";
  4.       var closeLabel = "Close";
  5.       var buttons = {};

  6.       buttons[enterLabel] = function()
  7.       {
  8.             $("#check_logpass_text").slideDown(1000);
  9.             //$("#Log in").fadeOut(1000);
  10.             //problem string
  11.             return 1;
  12.       }
  13.       buttons[closeLabel] = function()
  14.       {
  15.             closeDialog();
  16.       }
  17.       $("#win_login").dialog (
  18.       {
  19.             autoOpen: false,
  20.             title: "System log in",
  21.             position: ['center', 'center'],
  22.             modal: true,
  23.             resizable: false,
  24.             width: '330',
  25.             show: 'explode',
  26.             hide: 'explode',
  27.             buttons: buttons
  28.             });
  29.       }
  30. }
As you can see in string #12, i'm trying to reach "Log in" button inside the dialog form, but can't do it: the button, i guess, does not have any id or class, so i can't call it as above. My aim is to make the button dissapear after click on it. Method slideDown, situated a string above, works well: its' purpose is to show a part of text ("check_logpass_text" is a class).
I was also trying to call fadeOut like this:

  1. //$('buttons[enterLabel]').fadeOut(1000);
and like this:

  1. //$("#win_login").dialog ("option", "buttons").fadeOut (1000);

and even like this %)

  1. //$(this).fadeOut(1000);
but in first two cases it doesn't work at all, in the last one it hides the whole dialogs' document.

Thanks a lot for any help!
    • Topic Participants

    • eadel