PDA

View Full Version : Accessing form in a frame through DOM


concretegong
05-18-2007, 02:25 PM
I have a form that sits in an inline frame and I need to set the value of a hidden field in that form.

The frame is called 'googleMap'.
The form is called 'route', and the hidden field is called 'daddr'.

I have this but its not working...

document.googleMap.route.daddr.value=postcodeValue;

Please help

glenngv
05-18-2007, 05:23 PM
If 'googleMap' is the iframe name:
window.frames['googleMap'].document.route.daddr.value = postcodeValue;

If 'googleMap' is the iframe id:
document.getElementById('googleMap').contentWindow.document.route.daddr.value = postcodeValue;