The Default close button of a dialog just redirects to the previous page in the history. So if the dialog has a form and has some validation. If the user done some error in the form fillup then he will get error messages and the dialog will be shown for a no of times. so now the default close button will redirect to the previous dialog. So to reach the actual back page the user will need to press the close button multiple times which is a draw back. So to overcome this type of a situation we need to remove the default close button and add a custom back button which will redirect to the desired page. code to remove the default close button.
<style>.ui-dialog .ui-header a[data-icon=delete] {display:none;}</style>
add this line in the <head> section of the page.
code to add a custom back button
. <a href="url" data-role="button" data-icon="back" data-iconpos="notext" class="ui-btn-left">Back</a>
add this line in the header part of the page.