JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsWeb DesignJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old December 29th, 2004, 09:42 AM
ramonklown's Avatar
ramonklown ramonklown is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Location: Rio de Janeiro, Brazil
Posts: 447 ramonklown User rank is Private First Class (20 - 50 Reputation Level)ramonklown User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 2 Days 14 h 17 m 46 sec
Reputation Power: 10
function for onclick iframe value change

Someone help me out.
I have 3 Iframes I only want to play with 2.

1) One has links for others to click on :

//Iframe 1
<a href="javascript:click(email@email.com)">email@email.com</a>

2) The other Iframe will receive the value on hidden form and non-hidden form:

//Iframe 2 name="envia" id="envia"
<form method="post" name="frm2" action="">
<input type="text" name="email" value="">
</form>

Could someone make a working function please.


Here´s what I got on Iframe 1

<script language="javascript">
function click(email){
window.frames['envia'].frm2.email.value = 'iframe_page1.html';
alert('ok');
}
</script>
__________________
Help my country and sign the petition in favor of OS software. See the Petition
Quote:
Linux is like sex, it's better when it's free!

Reply With Quote
  #2  
Old December 29th, 2004, 01:02 PM
vbrtrmn's Avatar
vbrtrmn vbrtrmn is offline
4:04 Time Not Found
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Jan 2004
Location: Northern Virginia
Posts: 2,273 vbrtrmn User rank is Major (30000 - 40000 Reputation Level)vbrtrmn User rank is Major (30000 - 40000 Reputation Level)vbrtrmn User rank is Major (30000 - 40000 Reputation Level)vbrtrmn User rank is Major (30000 - 40000 Reputation Level)vbrtrmn User rank is Major (30000 - 40000 Reputation Level)vbrtrmn User rank is Major (30000 - 40000 Reputation Level)vbrtrmn User rank is Major (30000 - 40000 Reputation Level)vbrtrmn User rank is Major (30000 - 40000 Reputation Level)vbrtrmn User rank is Major (30000 - 40000 Reputation Level)vbrtrmn User rank is Major (30000 - 40000 Reputation Level) 
Time spent in forums: 1 Week 2 Days 22 h 10 m
Reputation Power: 337
Send a message via ICQ to vbrtrmn Send a message via AIM to vbrtrmn Send a message via MSN to vbrtrmn Send a message via Yahoo to vbrtrmn
I would like to help, but I don't understand what you are trying to do. You laid your code out, but it is unclear as to what the code is supposed to do.

For future reference, please use CODE tags:
Code:
your code here
__________________
I am so smart, I am so smart, S.M.R.T ... I mean S.M.A.R.T.

Stop Using Pop-Ups

Reply With Quote
  #3  
Old December 29th, 2004, 07:14 PM
ramonklown's Avatar
ramonklown ramonklown is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Location: Rio de Janeiro, Brazil
Posts: 447 ramonklown User rank is Private First Class (20 - 50 Reputation Level)ramonklown User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 2 Days 14 h 17 m 46 sec
Reputation Power: 10
Code:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>whatever</title>
</head>

<body>
<iframe width="300" height="400" src="?pagina=mensagens"></iframe>
<iframe width="100" height="400" src="?pagina=online" frameborder="0"></iframe><br>
<iframe width="400" height="250" id="envia" name="envia" src="?pagina=envia" frameborder="0" scrolling="no"></iframe>
</body>
</html>


I´m calling a link from the "online" frame

Code:
<html>
<head>
<script language="javascript">
function usuario(email){
window.frames['envia'].frm2.email.value = 'iframe_page1.html';
alert('ok');
}
</script>
<META HTTP-EQUIV=Refresh CONTENT="1; URL=<?=$url?>">
</head>
<body>
<a href="javascript:click(email@email.com)">email@email.com</a>
</body>
</html>


And want it executed and values to be shown on the email input inside the iframe envia
Code:
<form method="post" name="frm2" action="">
<input type="text" name="email" value="">
</form>

Reply With Quote
  #4  
Old December 29th, 2004, 10:23 PM
vbrtrmn's Avatar
vbrtrmn vbrtrmn is offline
4:04 Time Not Found
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Jan 2004
Location: Northern Virginia
Posts: 2,273 vbrtrmn User rank is Major (30000 - 40000 Reputation Level)vbrtrmn User rank is Major (30000 - 40000 Reputation Level)vbrtrmn User rank is Major (30000 - 40000 Reputation Level)vbrtrmn User rank is Major (30000 - 40000 Reputation Level)vbrtrmn User rank is Major (30000 - 40000 Reputation Level)vbrtrmn User rank is Major (30000 - 40000 Reputation Level)vbrtrmn User rank is Major (30000 - 40000 Reputation Level)vbrtrmn User rank is Major (30000 - 40000 Reputation Level)vbrtrmn User rank is Major (30000 - 40000 Reputation Level)vbrtrmn User rank is Major (30000 - 40000 Reputation Level) 
Time spent in forums: 1 Week 2 Days 22 h 10 m
Reputation Power: 337
Send a message via ICQ to vbrtrmn Send a message via AIM to vbrtrmn Send a message via MSN to vbrtrmn Send a message via Yahoo to vbrtrmn
Cool .. got it!
Okay, you're currently in the iframe with the src of "?pagina=online", as a side note you should probably give it a name, for consistancy.

From that iFrame, you can make a call to the "envia" iFrame with:
Code:
var YourValue = "I like JavaScript";
parent.envia.document.frm2.email.value = YourValue;


Of course you can set Your Value to whatever you want! If you need more, feel free to ask.

Reply With Quote
  #5  
Old December 29th, 2004, 10:30 PM
4thorder 4thorder is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2004
Location: USA MI
Posts: 40 4thorder User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
Send a message via ICQ to 4thorder Send a message via AIM to 4thorder Send a message via MSN to 4thorder
If I am readin this correctly you are asking about passing a varible between two frames?

well if that is the case then here it is:

iframeContainer.htm - contains both frames
Code:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<P><IFRAME name="Action" src="ActionPage.htm">
</IFRAME></P>
<P><IFRAME name="Target" src="TargetPage.htm">
</IFRAME></P>
</body>
</html>


ActionPage.htm - contains action to send email
Code:
<HTML>
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset=windows-1252">
<TITLE>ActionPage</TITLE>
<SCRIPT>
function passEmail(em)
{
top.frames['Target'].document.frm2.email.value = em;
alert(em)
}
</SCRIPT>
</HEAD>
<BODY>
<a href="javascript:passEmail('email@email.com')">email@email.com</a>
</BODY>
</HTML>



TargetPage.htm - cintains form to receive email
Code:
<HTML>
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset=windows-1252">
<TITLE></TITLE>
</HEAD>
<BODY>
<form method="post" name="frm2" action="">
<input type="text" name="email" value="">
email shows here</form>
</BODY>
</HTML>


here is a demo

Hope this helps!

Mike
4thorder(TM) Code Snippets and Full Scripts

Reply With Quote
  #6  
Old December 29th, 2004, 10:32 PM
4thorder 4thorder is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2004
Location: USA MI
Posts: 40 4thorder User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
Send a message via ICQ to 4thorder Send a message via AIM to 4thorder Send a message via MSN to 4thorder
opps sorry vbrtrmn

hit send before I saw your response

Mike

Reply With Quote
  #7  
Old December 29th, 2004, 10:36 PM
vbrtrmn's Avatar
vbrtrmn vbrtrmn is offline
4:04 Time Not Found
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Jan 2004
Location: Northern Virginia
Posts: 2,273 vbrtrmn User rank is Major (30000 - 40000 Reputation Level)vbrtrmn User rank is Major (30000 - 40000 Reputation Level)vbrtrmn User rank is Major (30000 - 40000 Reputation Level)vbrtrmn User rank is Major (30000 - 40000 Reputation Level)vbrtrmn User rank is Major (30000 - 40000 Reputation Level)vbrtrmn User rank is Major (30000 - 40000 Reputation Level)vbrtrmn User rank is Major (30000 - 40000 Reputation Level)vbrtrmn User rank is Major (30000 - 40000 Reputation Level)vbrtrmn User rank is Major (30000 - 40000 Reputation Level)vbrtrmn User rank is Major (30000 - 40000 Reputation Level) 
Time spent in forums: 1 Week 2 Days 22 h 10 m
Reputation Power: 337
Send a message via ICQ to vbrtrmn Send a message via AIM to vbrtrmn Send a message via MSN to vbrtrmn Send a message via Yahoo to vbrtrmn
Quote:
Originally Posted by 4thorder
hit send before I saw your response

Mike


No problem! I'm sure he'll be happy with any help he can get I'm glad to see others trying to help people out!

Thanks!

Reply With Quote
  #8  
Old December 30th, 2004, 05:20 AM
ramonklown's Avatar
ramonklown ramonklown is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Location: Rio de Janeiro, Brazil
Posts: 447 ramonklown User rank is Private First Class (20 - 50 Reputation Level)ramonklown User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 2 Days 14 h 17 m 46 sec
Reputation Power: 10
Talking

First thanks to vbrtrmn for his great effort on solving this, and pointing out that it was a messy explanation.

Second thanks to 4thorder for making a working example for me so I can have a "base" solution for this. (great job)

My problem is now solved thanks to you guys, Dev Shed and god.

Peace

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignJavaScript Development > function for onclick iframe value change

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap