简体   繁体   中英

tinyMCE modal box dialog

I want to make a button and when it's clicked then modal box opens where user have to enter url, click insert and then url is inserted to editor. So far I have added button and opened modal box but how could I get back those values? Thanks.

If you're using window.showModalDialog to open your modal dialog box, then according to MSDN , it sounds like you can return a value from the modal dialog by setting the returnValue property on window. It sounds like it will work in Firefox as well, based on the Mozilla documentation. In the dialog window, you would set the returnValue property:

window.returnValue = GetTheUrlThatWasTypedIn();

And then in the parent window, retrieve it into a variable when you open the modal dialog:

var theUrl = window.showModalDialog(/* parameters go here */);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM