Click to See Complete Forum and Search --> : frames and onload function for changing form action


hooba
01-10-2003, 05:05 AM
I'm really stuck....

At http://folk.uio.no/leikh/nyheter/ i have an index.html with two frames. The top frame has a link to a 'tell-a-friend' (http://folk.uio.no/leikh/nyheter/tipsnyhet.html) that opens in same frame.
The idea is that when loading this page i want it to read the
url of the content of the second frame, and parse it to the action field in the 'tell-a-friend' form...
This does not happen :(


Here's the HTML:

<html>
<head>
<title>tips en venn</title>
</head>

<body
onload="document.tips.action='http://home.no.net/leik/mailpage/mailpage.cgi?'+parent.nyheter.location.href">
<center>
<form action='' method="post" name="tips">
<input type="hidden" name="action" value="send">
<input type="hidden" name="url" value="">

Avsender <input type="text" name="sendername" value="" size="10">
&nbsp;
epost<input type="text" name="senderemail" value="" size="10">
&nbsp;
Mottaker <input type="text" name="recipient" size="10">
&nbsp;
epost:<input type="text" name="recipientemail" size="10">
&nbsp;
Melding?
<input type="text" name="message" size="10">
<input type="hidden" name="how" value="body">
&nbsp;
<input type="submit">
</table>
</center>
</form>

</body>
</html>

hooba
01-10-2003, 06:34 AM
it's same domain...
i've tried onload=alert(parent.nyheter.location.href);
and that works...

og did you perhaps mean the cgi-script? yes, that's on a different domain...

hooba
01-10-2003, 08:10 AM
the problem was finally with perl...
fixed it with adding a hidden field, and let the onload fill this with the wanted url :)