close jquery ui dialog box with form button

close jquery ui dialog box with form button

my parent page launches a jquery ui whose conntent is loaded from a html page. the html page has a form button named 'btnsave'
 
'btnsave' onclick performs some db update and then the user clicks on jquery 'close' button to close the modal form.
 
is there a way that when btnsave onlcik is called, the db fn are called and then it can close the jquery ui modal form?