473,394 Members | 1,841 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,394 software developers and data experts.

passing a value from one html into another html

1
Hi

I have a html page, which has some sites, when the user clicks on the site,
[HTML]<tr><td><a href="us.html" onclick = "setSiteCode('US')">USA</a></td></tr>[/HTML]
and the javascript is,

Expand|Select|Wrap|Line Numbers
  1. var siteCode = "";
  2. function setSiteCode(site)
  3. {
  4. window.siteCode=site;
  5. false;
  6. }
  7. function getSiteCode()
  8. {
  9. return window.siteCode;
  10. }
  11.  
After navigating to the next page, it has to get the information relevant to that site, I have this in the us.html
[HTML]<FRAMESET rows="12%,89%" cols="*">
<FRAME SRC="siteTitle.html" name="title">
<FRAMESET cols="15%,65%,20%">
<FRAME SRC="menu.html">
<FRAME SRC="detail.html" name="detail">
<FRAME SRC="quickLaunch.html">
</FRAMESET>
</FRAMESET><noframes></noframes>[/HTML]


and in siteTitle.html I have this,

[HTML]<td><a href="title.html" onclick="goToMain('index.html')"> Home</a>&nbsp;&gt;&nbsp;<script>document.write(getSiteNa me())</script></td>
[/HTML]
But when I run, it is not getting set, the getSiteName is still empty.

Would greatly appreciate your help on this. I do not know what is wrong.

Thanks,
Mar 12 '07 #1
3 1999
acoder
16,027 Expert Mod 8TB
To pass values, you can use the search property string (the string after the '?'), see link or you can use server side code. Since you are using Javascript, you can try:
Expand|Select|Wrap|Line Numbers
  1. src="setTitle.html?title=US"
Then parse the location.string to get the 'US' value and display that on the screen.
Mar 13 '07 #2
dmjpro
2,476 2GB
a good thing i came to know ....

thanxxx
Mar 13 '07 #3
acoder
16,027 Expert Mod 8TB
Alternatively, you can even try
Expand|Select|Wrap|Line Numbers
  1. siteTitle.html?us
and just use the whole query search string.
Mar 13 '07 #4

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

Similar topics

2
by: Phillip Wu | last post by:
Hi, I saw a previous post about sending arrays but did not quite understand the answers. The problem is that I would like to pass an entire array as a hidden input field from one php script...
12
by: Kevin Lyons | last post by:
Hello, I am trying to get my select options (courses) passed correctly from the following URL: http://www.dslextreme.com/users/kevinlyons/selectBoxes.html I am having difficulty getting the...
1
by: Kevin Lyons | last post by:
Hello, I am trying to get all of my form elements passed correctly from the following URL: http://www.dslextreme.com/users/kevinlyons/selectBoxes.html to the following URL:...
2
by: Richard | last post by:
**** Post for FREE via your newsreader at post.usenet.com **** HI, I am working on a project where I need to input data to a (local) HTML page using multiple form elements, such as text,...
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 =...
58
by: jr | last post by:
Sorry for this very dumb question, but I've clearly got a long way to go! Can someone please help me pass an array into a function. Here's a starting point. void TheMainFunc() { // Body of...
10
by: Geoff Cox | last post by:
Hello, I have written before that I can pass a variable from page 1 to page 2 if I call the variable "name". Stephen Chalmers has written, >'name' is effectively a reserved word as the...
13
by: Abe Frohnman | last post by:
Hello all, I'm passing a reference to a class into the constructor of a form, like so: public MyForm(int count, ref Area myArea) {...} How can I use myArea outside the constructor? Should I...
6
by: ged | last post by:
Hi, i am a oo (c#) programmer, and have not used javascript for a while and i cant work out how javascript manages its references. Object References work for simple stuff, but once i have an...
3
by: James Robertson | last post by:
I am new to the ASP and VB thing so be kind. Question I have is that I have created an ASPX web site to use as an E-Mail page. But I want to use this for a lot of users. Can I create the link on...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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.