Nikku/jquery-bootstrap-scripting — Issue #19: auto closing final confirmation
Author: jerzyk
Created: 2011-10-16 21:52:42+00:00
State: open

It may be useful to have an option to automatically close after successful form submission.

My idea is to add handling of the "close" button, adding this code at the beginnig of `__ajaxify` function:

```
var autoclose = e.find("a.auto-close");
if (autoclose.length > 0) {
this.close();
var href = autoclose.attr('href');
if (href)
window.location.replace(href);
return
}
```
This will allow to have additional class in te markup of the final "confirmation page":

```
Close
```

if `href` will be empty - it will just close a dialog, if not - main page will reload with specified URL as destination.