niutech / showModalDialog

window.showModalDialog polyfill using a <dialog> element
https://niutech.github.io/showModalDialog/demo.html
Apache License 2.0
177 stars 88 forks source link

How to pass back a value #49

Open stevyrino opened 4 years ago

stevyrino commented 4 years ago

I am trying to make an old IE form work with a showModalDialog. This worked well with IE. I have a modal form that, based on a selected criteria, makes a request to a database for a primary key. I can't figure out how to pass that value back to the parent form. I figure I have to stuff it somewhere but in the original code it was done with "window.returnValue = key;". This does not work with the polyfill. Any help would be appreciated. I am thinking the polyfill should be a direct replacement for the old IE showModalDialog. Parent form: (function() {
pParty = window.showModalDialog("../Search.htm", "SearchParty", "resizable:yes;status:no;dialogHeight:550px;dialogWidth:600px"); })();

Dialog prior to clicking on close button: var arr = new Array(getHTMLText(mRow.cells[1]), getHTMLText(mRow.cells[2]), getHTMLText(mRow.cells[3])); window.returnValue = arr;

stevyrino commented 4 years ago

PS: I am using Chrome browser.