Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
Copying Form Contents to another form through frames
Old 09-30-2009, 08:54 PM Copying Form Contents to another form through frames
downliner's Avatar
Extreme Talker

Posts: 209
Location: Orkney
Trades: 1
I'm trying to pass the contents of the form in the left frame to the form in the right frame. Its working locally with the below code, however when I try to fill out a form on an external URL I receive an access denied error.

# index.html
--------------------
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
"http://www.w3.org/TR/html4/frameset.dtd">
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>My Frameset</title>
</head>

<frameset cols="300,*" frameborder=1>
<frame name="left" src="pass-textbox-framesl.html">
<frame name="right" src="pass-textbox-framesr.html">
</frameset>

<noframes>
<body><p>Your browser does not support frames.</p></body>
</noframes>
</html>
# pass-textbox-framesl.html
--------------------
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Left Frame</title>
<html>
<script type="text/javascript">
<!-- //
function Transfer(here, there)
{
there.elements['text1'].value = here.elements['text1'].value;
there.elements['text2'].value = here.elements['text2'].value;
there.elements['text3'].value = here.elements['text3'].value;
there.elements['text4'].value = here.elements['text4'].value;
there.elements['text5'].value = here.elements['text5'].value;
return true;
}
// -->
</script>
</head>

<body>

<form>
<p>Name: <input type="text" name="text1" size="16"></p>
<p>Address: <input type="text" name="text2" size="16"></p>
<p>Address 2: <input type="text" name="text3" size="16"></p>
<p>Town: <input type="text" name="text4" size="16"></p>
<p>County: <input type="text" name="text5" size="16"></p>
<p><input type="button" value="Transfer"
onclick="return Transfer(this.form, top.frames['right'].document.forms[0])"></p>
</form>

</body>
</html>
# pass-textbox-framesr.html
--------------------
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Right Frame</title>
<html>
</head>

<body>

<form action="">
<p>Text1: <input type="text" name="text1" size="16"></p>
<p>Text2: <input type="text" name="text2" size="16"></p>
<p>Text3: <input type="text" name="text3" size="16"></p>
<p>Text4: <input type="text" name="text4" size="16"></p>
<p>Text5: <input type="text" name="text5" size="16"></p>
</form>

</body>
</html>
What am I missing here? We fill in the shipping details on our couriers website on a daily basis and Im hoping its possible to pass our customer details straight to their forms
__________________

Please login or register to view this content. Registration is FREE

Last edited by downliner; 09-30-2009 at 08:57 PM..
downliner is offline
Reply With Quote
View Public Profile Visit downliner's homepage!
 
 
Register now for full access!
Old 10-02-2009, 01:21 AM Re: Copying Form Contents to another form through frames
prasanthmj's Avatar
Experienced Talker

Posts: 42
Name: Prasanth
Trades: 0
If the two pages are on different domains you will get this error.
Perhaps you can use the technique described in the page below(the second form submission is done on the server side using PHP):
submit a form using PHP
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
prasanthmj is offline
Reply With Quote
View Public Profile
 
Old 10-03-2009, 12:24 AM Re: Copying Form Contents to another form through frames
Junior Talker

Posts: 1
Name: strgisimp
Trades: 0
Quote:
Originally Posted by prasanthmj View Post
If the two pages are on different domains you will get this error.
Perhaps you can use the technique described in the page below(the second form submission is done on the server side using PHP):
submit a form using PHP
I have the same idea with you. Great! Thanks for sharing.
Glad to hear you're using this: I plan to keep it much more aggressively up-to-date than has been the case in the past, but don't hesitate to let me know if you find errors or need clarifications.
__________________

Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE
strgisimp is offline
Reply With Quote
View Public Profile
 
Old 10-03-2009, 12:17 PM Re: Copying Form Contents to another form through frames
Average Talker

Posts: 23
Name: Mary North
Trades: 0
Thanks for the code update. I tried it on one of my scripts.
__________________

Please login or register to view this content. Registration is FREE
marynorth21 is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Copying Form Contents to another form through frames
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.57911 seconds with 12 queries