473,396 Members | 1,968 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

passing values between html pages using frames

54
hello there,
as the title ggoes, i want to pass values btn html pages in the same frame.
i've two framesets, top frmeset and bottom set, in the bottom frameset there are three frames, frame1,frame2 ,frame3.
i want to load different page in frame3 by using buttons in frame2. and once frame3 is loaded based on the radio button selection i want to load another page in the same frame i.e. frame3 and pass the value of radio button to a textbox in that newly loaded page.

please some one help me
thanks in advance
Feb 7 '08 #1
10 4202
acoder
16,027 Expert Mod 8TB
Post your code or, better still, a link to a test page. Also have a read of this article.
Feb 7 '08 #2
sindhu
54
Thanks for the reply

the code goes as follows

Expand|Select|Wrap|Line Numbers
  1. function getpage(val)
  2.  {
  3.  //alert(num);
  4.  self.location='page2.html?'+val;  
  5.  
  6.  document.frame2.txt2.value =val;
  7.  
  8.  
  9.   }
  10.  
  11.  
here val is the value to be passed
self.location replaces the page at that frame with the given html page
frm2 if the frame in the new page
txt2 is the control where i want the val to be saved in the second page

but this is not working fine . it does go to the second page but the val is not shown in the textbox of second page

please help
Feb 7 '08 #3
acoder
16,027 Expert Mod 8TB
Since you're changing the location of the current page, the rest of the code won't execute. You are passing the value in the URL, so use the location.search property in the new page, page2.html. You can set the textbox value onload.
Feb 7 '08 #4
sindhu
54
Hi i did that in the new page as below
var query =window.location.search;

......script...................

document.frm2.txt2.value=window.location.search.su bstring(1);

..........
frm2 is the frame name in new page
the value is being passed i can get it in alert box
but it is not substituted in the textbox txt2
the error its showing up is 'the document.frm2.txt2' is null or not an object
thanks
Feb 7 '08 #5
acoder
16,027 Expert Mod 8TB
So now we're getting somewhere. Post the code for the new page.
Feb 7 '08 #6
sindhu
54
for sending page


Expand|Select|Wrap|Line Numbers
  1.  function change_page(num)
  2.   {
  3.      //alert(num);
  4.      self.location='page2.html?'+num;  
  5.   }
  6.  


for receiving page

[HTML]<script language="javascript" type="text/javascript">
var query =window.location.search;
alert(query.substring(1));
document.frm2.txt2.value=query;
</script>[/HTML]
Feb 7 '08 #7
sindhu
54
here is the script in both the pages


for sending page


Expand|Select|Wrap|Line Numbers
  1.    function change_page(num)
  2.    {
  3.      //alert(num);
  4.       self.location='page2.html?'+num;  
  5.    }
  6.  

for receiving page

Expand|Select|Wrap|Line Numbers
  1.          <script language="javascript" type="text/javascript">
  2.           var query =window.location.search;
  3.           alert(query.substring(1)); 
  4.              document.frm2.txt2.value=query;
  5.          </script>
  6.  
thanks for such a quick reply
Feb 7 '08 #8
acoder
16,027 Expert Mod 8TB
Is the code in the receiving page in the head. If it is, the textbox will be undefined. Put the code in a function and call it body/window onload.

Please use code tags when posting code. Thanks!
Feb 7 '08 #9
sindhu
54
thanks alot for your timely help
its working. :) :)
Feb 8 '08 #10
acoder
16,027 Expert Mod 8TB
You're welcome. Glad it helped.
Feb 8 '08 #11

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Paul | last post by:
Hmmm, didn't seem to work. I have set session.use_cookies = 1 and session.use_trans_sid = 1 in my php.ini file. Index.php contains:...
11
by: Dthmtlgod | last post by:
I am having a little difficulty in passing a value from a page to another page. I am going to provide excerpts from the code. I think I am close. This is from Page1.ASP <% Set Conn =...
1
by: cirillo_curiosone | last post by:
Hi, i'm new to javascript. I started studing it on the web few weeks ago, but still haven't been able to solve one big problem: HOT TO PASS VALUES FROM A SCRIPT VARIABLE TO A CHILD HTML...
3
by: Evan | last post by:
I have a web page with 2 frames. The left frame is running menu.aspx and the right frame is running images.aspx. When a selection is made in menu.aspx I call a method in images.aspx and pass a...
1
by: | last post by:
Hi, 1st, I did a search and could not find any info on this, the Google results were good, but I'm still have issues...So any help will be great. I have a frame page, which contains 3 frames...
8
by: rn5a | last post by:
I have a HTML page named Index.html which is divided into 3 frames. The URL of 2 of the frames are HTML pages but the 3rd frame houses a ASP page. Now when I go to Windows Explorer, navigate to...
2
by: maniji | last post by:
Dear All, Very Good Moring ,Please Help: I have a loginpage that calls a html pages with frames. This frame page has 3 pans. To the left pane I have added buttons . My requirment is when i...
13
by: sindhu | last post by:
Hello acoder. I want to know another type of passing values between pages I have three frames frame1 for main horizontal menu frame 2 for vertical submenu frame 3 which is is loaded based on...
25
by: Geoff Cox | last post by:
Hello, The following <frame src="topbar-frameset.php?newVar=<?php echo $groups; ?>"> passes the value of the variable $groups from a php file to the top page in a frameset but how do I...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.