I have created an aspx page and I have created 1 custom save button and 1 cancel button :
<input type="button" id="savebutton" value="Apply for Vacancy" name="btnSave" onclick="javascript: {ddwrt:GenFireServerEvent('__commit')};" />
<input type="button" value="Cancel" name="btnCancel" onclick="javascript: window.frameElement.commitPopup();" />
After I click the cancel button the dialog is being closed, but when I click Save
button the dialog is not closing.
I have tried this code for saving button:
onclick="javascript: {ddwrt:GenFireServerEvent('__commit')}; window.frameElement.commitPopup();"
It works in internet explorer but in chrome it is not working. so how can I made this to work in both browsers.
DIALOG FUNCTION
function openDialog(idja) {
var options = {
url: 'http://mysite/sites/stonehr/Lists/mylist/DispForm.aspx?ID=' + idja,
title: 'mylist',
allowMaximize: true,
showClose: true,
width: 600,
height: 900
};
SP.SOD.execute('sp.ui.dialog.js', 'SP.UI.ModalDialog.showModalDialog', options);
}
Thanks