•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 456,515 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,766 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 3681 | Replies: 6
![]() |
•
•
Join Date: Oct 2007
Posts: 8
Reputation:
Rep Power: 0
Solved Threads: 0
Hi,
I have 2 frames
Topmenu
bottommenu
in topmenu i have a drop down
when the drop down value is selected i want to refresh the bottom frame and pass the gender of the student
So here is my code this code refreshes the bottom frame
when i try to sent the value by this code
it doesnt refresh the frame nor does it transfer the value
can someone tell me what i am doing wrong
todd
I have 2 frames
Topmenu
bottommenu
in topmenu i have a drop down
when the drop down value is selected i want to refresh the bottom frame and pass the gender of the student
So here is my code this code refreshes the bottom frame
function transval()
{
top.bottommenu.document.location.reload();
}when i try to sent the value by this code
function transval()
{
var sentgen=document.frm1.txtgender.value;
alert(sentgen);
var bottomURL = "bottommenu.asp?gen=" + sentgen;
top.frames['bottommenu'].location.href = bottomURL;
it doesnt refresh the frame nor does it transfer the value
can someone tell me what i am doing wrong
todd
>
It should be
top.bottommenu.document.location.reload();It should be
top.frames['bottommenu'].location.reload();. location is a property which belongs to the window object and not the document object. Plus you are confusing others by pasting two functions with the same name and different function definitions. Be a bit more concise and clear the next time. I don't accept change. I don't deserve to live.
Happiness corrupts people.
Failing to value the lives of others cheapens your own.
Happiness corrupts people.
Failing to value the lives of others cheapens your own.
•
•
Join Date: Oct 2007
Posts: 8
Reputation:
Rep Power: 0
Solved Threads: 0
Sorry about my code i tried to do it in two ways thats why.
Ok so now when i select a value in the drop down in the top frame it refreshes the bottom frame with the code that you gave me
Can you tell me how i can sent a variable to the bottom frame and also refresh the bottom frame
I want to sent a variable that holds gender of the student to the bottom frame
Again thanks for all your help
todd
Ok so now when i select a value in the drop down in the top frame it refreshes the bottom frame with the code that you gave me
Can you tell me how i can sent a variable to the bottom frame and also refresh the bottom frame
I want to sent a variable that holds gender of the student to the bottom frame
Again thanks for all your help
todd
•
•
Join Date: Oct 2007
Posts: 8
Reputation:
Rep Power: 0
Solved Threads: 0
Hello,
I tried this code to refresh the frame and also pass the gender value
but the frame refresh doesnt happen and also the variable is not passed
Can you tell me what i am doing wrong
todd
I tried this code to refresh the frame and also pass the gender value
var bottomURL = "bottommenu.asp?gen=" + sentgen; top.frames['bottommenu'].location.href = bottomURL;
but the frame refresh doesnt happen and also the variable is not passed
Can you tell me what i am doing wrong
todd
•
•
Join Date: Oct 2007
Posts: 8
Reputation:
Rep Power: 0
Solved Threads: 0
Thanks for your reply.
I tried both codes it didnt work
you had
i changed it to the code as displayed belowed as bottommenu is the name of the frame
below is how my frames look like
this is driving me nuts with this frame thing
todd
I tried both codes it didnt work
you had
top.frames['bottom'].location.replace(bottomURL); or top.frames['bottom'].location.assign(bottomURL);
top.frames['bottommenu'].location.replace(bottomURL); or top.frames['bottommenu'].location.assign(bottomURL);
<frameset rows="75%,*"> <frame name="topmenu" id="topmenu" src="topmenu.asp"> <frame name="bottommenu" id="bottommenu" src="bottommenu.asp"> </frameset>
this is driving me nuts with this frame thing
todd
•
•
Join Date: Oct 2007
Posts: 8
Reputation:
Rep Power: 0
Solved Threads: 0
Hi,
I have this page called one.asp
So then you see a page who has 2 frames
in the topmenu.asp there is a drop down which has students name
then when you select the name it will display the score for the athlete in top frame
and then in bottom frame it will rank the athlete for his gender
so if u select a male it will show where you rank as compared to other males in the bottom frame
so for me to make that ranking happen i have to transfer the gender to the bottom frame when the
value in drop down is selected
so here is my code
so i found out what the problem is
when you select the value in drop down page is refreshed it finds out the details for the student and
it saves the gender of student in the hidden field
But now say there are 2 students
John Smith
Rachel Doe
When you select John smith for first time in drop down his gender is not there in the hidden field
can someone tell me whats the best way of doing it
if i can get the value of gender in javascript function then i am good to go and the code will work
any ideas
todd
I have this page called one.asp
<frameset rows="75%,*"> <frame name="topmenu" id="topmenu" src="topmenu.asp?id=<%=getmainid%>"> <frame name="bottommenu" id="bottommenu" src="bottommenu.asp?id=<%=getmainid%>"> </frameset>
So then you see a page who has 2 frames
in the topmenu.asp there is a drop down which has students name
then when you select the name it will display the score for the athlete in top frame
and then in bottom frame it will rank the athlete for his gender
so if u select a male it will show where you rank as compared to other males in the bottom frame
so for me to make that ranking happen i have to transfer the gender to the bottom frame when the
value in drop down is selected
so here is my code
<%
Dim getid
getid=Trim(Request.querystring("id"))
%>
<html>
<head>
<title>Athletes Scores</title>
<script type="text/javascript">
<!--
function changedropnameath()
{
var getnder=document.frm1.getnewstgen.value;
alert(getnder);
var bottomURL = "bottommenu.asp?gen=" + getnder;
alert(bottomURL);
top.frames['bottommenu'].location.assign(bottomURL);
}
// -->
</script>
</head>
<body >
<form name="frm1" id="frm1" method="post">
Name: <select name="ath" id="ath" size="1" onChange="this.form.action = '<%=Request.ServerVariables("Script_Name") &"?id=" & getid%>'; this.form.submit(); changedropnameath();">
<option value="">Select a Name</option>
<%
Set rstsub = Server.CreateObject("adodb.RecordSet")
strsql="Select * from students order by Lname"
rstsub.Open strsql,Conn, 2, 2
If Not rstsub.eof Then
Do While Not rstsub.eof
%>
<option <%if Trim(rstsub("Id"))=Trim(Request.Form("ath")) then Response.Write "selected" end if%> value=<%=rstsub("Id")%>><%=rstsub("Name")%></option>
<%
rstsub.MoveNext()
Loop
End if
rstsub.Close
Set rstsub = Nothing
%>
</select>
<%
getathid=Trim(Request.Form("ath"))
If getathid <> "" then
Set rsgetath = Server.CreateObject("adodb.RecordSet")
strgetath="Select * from studentsscore where Id='" & getathid & "' and Main_Id='" &getid& "'"
rsgetath.Open strgetath,Conn, 2, 2
getnewstgen=rsgetath("Gender")
%>
<input type="hidden" name="getnewstgen" value="<%=getnewstgen%>"/>
<%
End if
%>
</form>
</body>
</html>so i found out what the problem is
when you select the value in drop down page is refreshed it finds out the details for the student and
it saves the gender of student in the hidden field
But now say there are 2 students
John Smith
Rachel Doe
When you select John smith for first time in drop down his gender is not there in the hidden field
can someone tell me whats the best way of doing it
if i can get the value of gender in javascript function then i am good to go and the code will work
any ideas
todd
![]() |
•
•
•
•
•
•
•
•
DaniWeb JavaScript / DHTML / AJAX Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- Parent/Child Windows References (JavaScript / DHTML / AJAX)
- Open in window, not frame (HTML and CSS)
- frame question (VB.NET)
- Place your link at Zoomash.co.uk (Ad Space for Sale)
- Adding mouse listener to a frame (Java)
- wxPython Error while running. (Python)
- DVD format cuts 720x480 frame?? (Computer Science and Software Design)
- HttpContext (VB.NET)
- linking to specific frame arrangements? (Computer Science and Software Design)
Other Threads in the JavaScript / DHTML / AJAX Forum
- Previous Thread: Need help implementing a javascript function
- Next Thread: Rss, php, javascript nightmare! help?



Linear Mode