Tommi
03-13-2003, 05:46 PM
Okay, I'm trying to write a function which has to access form elements of a document within an iframe for Mozilla 1.2.1
Here is the simplified code sample:
<script languag="JavaScript">
function x()
{
document.getElementById('i_anotherdocument').document.forms[0].anotherdocuments_inputline.value = 'whatever'; // does not work
frames['i_anotherdocument'].document.forms[0].anotherdocuments_inputline.value = 'whatever'; // does not work, either
}
</script>
<body>
<div id="anotherdocument">
<iframe id="i_anotherdocument" name="i_anotherdocument" src="anotherdocument.html"></iframe>
</div>
</body>
I hope you have a clue. The IE version works fine and now I'm trying to make it compatible with Mozilla.
Here is the simplified code sample:
<script languag="JavaScript">
function x()
{
document.getElementById('i_anotherdocument').document.forms[0].anotherdocuments_inputline.value = 'whatever'; // does not work
frames['i_anotherdocument'].document.forms[0].anotherdocuments_inputline.value = 'whatever'; // does not work, either
}
</script>
<body>
<div id="anotherdocument">
<iframe id="i_anotherdocument" name="i_anotherdocument" src="anotherdocument.html"></iframe>
</div>
</body>
I hope you have a clue. The IE version works fine and now I'm trying to make it compatible with Mozilla.