window.opener.document javascript error

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

window.opener.document javascript error

barreroandres
I've been using regular window.open for modal new windows to display information and return some values to the previous page.
Now implementing shadowbox, i don't know how to return such values to the parent page

I have this basic code to open the shadowbox:

<script type="text/javascript"> var openShadowbox = function(content, player, title){ Shadowbox.open({ content: content, player: player, title: title, height: 500, width: 400 }); }; function OpenNewShadowBox(){ openShadowbox('windows/findId.asp', 'iframe', 'window name'); } </script>

in the new shadowbox page when the search is finished is a JS to return some parameters and close the page:

<script> function vEnter(valueToReturn){ window.opener.document.form1.cas_id.value = valueToReturn; window.close(); } } </script>

all is fine until the vEnter function is called.. this is the js error.

window.opener.document is null or not an object

how can i reference the object in the parent page from the shodowbox page...


thank you!!

Reply | Threaded
Open this post in threaded view
|

Re: window.opener.document javascript error

bmccune
window.parent.Shadowbox or window.parent.document

might try that or something along those lines.
Reply | Threaded
Open this post in threaded view
|

Re: window.opener.document javascript error

barreroandres
Thank you...finally worked with...

parent.document.getElementById('dddd').value

or

parent.document.myformname.dddd.value

Reply | Threaded
Open this post in threaded view
|

Re: window.opener.document javascript error

dhvani
hi,
This is not workig in IE.

I used the same code and works very fine in ff or chrome but not working in ie.

Please reply me if any solution.

Thanks

Dhvani