|
Title: Fetch value in easyui dialog frame from parent html [Solved] Post by: Darrel on August 03, 2018, 10:49:30 AM Hello Team,
I have a some fields with the ids, say, 'stud_name' and 'stud_age' on an html page. I'm calling a dialog box on submit, which has a frame, to show the details based on the stud_name field's value. I want to access the value of the parent frame fields in the dialog box on successful load of the dialog box. Code: <!-- HTML Code --> Code: //javascript code How can I access the stud_name/stud_age fields value in 'somehtmlFile.html' without passing it in the src of the frame or dialog box using pure javascript or jquery or easyui syntax. Regards, Darrel Title: Re: Fetch value in easyui dialog frame from parent html Post by: stworthy on August 03, 2018, 04:46:59 PM You should use postMessage to send data to the iframe.
1. In the iframe, build the message receive function. Code: window.addEventListener('message', function(data){Code: $('#dlg').find('iframe')[0].contentWindow.postMessage('hello','*')Title: Re: Fetch value in easyui dialog frame from parent html Post by: Darrel on August 31, 2018, 06:24:53 AM Hello stworthy,
I was able to solve it using this concept. Thanks a lot. Got to learn something new in frame communications... |