change text field from within an iframe
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.javascript archive

change text field from within an iframe

From: sid derra <ng_at_emolife.net@arcor.de>
Date: Fri Mar 31 2006 - 14:00:08 CEST

hi

i am trying to change the value of a text field on my page dynamically,
every time an iframe loads.

#==========

the code where the text field is looks like this:

<form name="test_form">
<input type="text" name="test_field" value="initialized" />
</form>

#==========

the iframe is embedded like this:

<iframe src="iframe_content.php" name="page" />

#==========

and the iframe_content.php site does this, before it gets to the <html> tag:

<script language="javascript">
document.parent.test_form.test_field.value = 'page X loaded';
</script>

#==========

i also have tried "frames[0]" and "parent" instead of "top". no success.
what i want it to do is, as soon as he iframe_content.php site loads, the
text field (test_field) should show "page X loaded", where "X" is a value
that's being dynamically set.
the problem is, that it doesn't do that. any ideas on what i would have to
change?

thanks a lot in advance!
sid
Received on Mon May 1 04:34:01 2006