How close the admin overlay on submit for a drupal form shown within the admin overlay I'm currently showing a drupal form via the admin overlay. I'm using jQuery to perform the processing of the form.

The problem I have is how do I close the overlay on submit? right now the only way to close the overlay is by pressing the X at the top right (well based on the default theme), which is just a .

Now I'm presuming that I could somehow change the form to add the "overlay-close" to the submit button, but I'm not sure how to do this.

Is there a way to add a class to a button on a form in drupal?

Cheers,

James
I don't have experience with the admin overlay, but from what you are writing, I understand that you want to add the class "overlay-close" to an element (admin overlay?) when submit button is pressed. You can adapt the following code for that:

$('#form_id').submit(function(){
  // Add "overlay-close" class to the proper element
  $('#element').addClass('overlay-close');
});