Hi everyone,

I'm building a module with a customized user profile page where the user can go and change their personal information. I'm working with jQuery UI dialog for entering the user data, but now I'm stuck on trying to pop up the jQuery UI date picker widget so that users can change their date of birth. The form parts of the module look like this:

$rows[] = array('First name: '. "$profile_2_name[0]".' '. '<button id="button1" class="special-button">edit</button>');
$rows[] = array('Date of birth: '. "$user_birth_date". ' '. '<button id="button2" class="special-button">edit</button>');

and the script

(function ($) {
  
Drupal.behaviors.Mymodule = {
    attach: function (context, settings) {

$("#button1").click(function () {

$('<div id="a">First name:<input id="new_name" input type="text" style="user-name" maxlength="15"</div>'
).dialog({

// Validation and AJAX stuff

});
});
 
$("#button2").click(function() {

// I don't know what to put here !!

     });
  }
};
}(jQuery));

Whatever I do I cant find the right code to put inside the #button2 event to make the datepicker pop up when the use clicks "edit". Any help is greatly appreciated.