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.


 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);



  • what error are you getting in chrome?? f12 and get the generated output
    – Ali Jafer
    Oct 13, 2016 at 14:20
  • the error is that it is not saving the item Oct 13, 2016 at 14:22
  • so on chrome its not outputting any error?
    – Ali Jafer
    Oct 13, 2016 at 14:22
  • no there is not any error output Oct 13, 2016 at 14:29
  • do you know what method your using or is used to create the popup?
    – Ali Jafer
    Oct 13, 2016 at 15:03

1 Answer 1


looks like the form is saving just need to redirect:

do the following on save button:

javascript: {ddwrt:GenFireServerEvent('__commit;__redirectsource;')}
  • no problem happy to help
    – Ali Jafer
    Oct 14, 2016 at 14:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.