Click to See Complete Forum and Search --> : Forms within frames
rincewind
11-28-2003, 08:20 AM
Hi,
I have drop down select form in a frame on a page and when I select a value and I want to post the selected value to another frame within the same page. How can I include the target frame within the action description?
Thanks
clairec666
11-28-2003, 08:22 AM
Hah, I've done something like this before............ it's floating around in there somewhere (in my brain, that is!)
Can you describe what you want to happen once you have submitted the information??
And if anyone else can help, please do, since it will take alot of digging to reach those ancient thoughts...........
rincewind
11-28-2003, 08:31 AM
basically, when i select a value from the menu in frame 1 i want frame 2's drop down menu's content to change accordingly i.e. if a certain team is picked in frame 1 the menu in frame 2 loads the player names for that team. So i need to pass the selected team name to frame 2.
Any ideas?
Thanks
clairec666
11-28-2003, 08:37 AM
I know what you mean................. I have a similar thing at home, I can e-mail it to you if you want, or post it up here tomorrow. Sorry - I can't get to my own computer at this moment in time. I definately have the solution though!
rincewind
11-28-2003, 08:40 AM
i appreciate that but i need asap, can u even point me in the right direction?
clairec666
11-28-2003, 08:41 AM
Can you post on here what you already have? I only have about 5 minutes :(
rincewind
11-28-2003, 08:46 AM
it's ok, thanks again, i appreciate it, there's 2 many files 2 post and explain... if u can send on the solution when u get a chance that be great
clairec666
11-28-2003, 08:46 AM
Sorry - I've got to go. Do you know how to do a similar thing, but with two forms within the same frame? If so, change the document.forms.formname.select etc. to document.frames.left.forms.formname.... where the frame you want to reference is called 'left'
Hope this helps
clairec666
11-28-2003, 03:50 PM
Hey, hope you're still out there................ I've found what you're looking for and put the code below. I've just realised that you wanted the first list to be a drop-down menu, but my version currently has radio buttons for this part, hope this is OK!
Claire
frameset.html
<frameset cols=*,*>
<frame name="left" src="toggle2.html">
<frame name="right" src="toggle.html">
</frameset>
toggle.html
<HTML>
<HEAD>
<script type="text/javascript">
<!--
parent.frames.left.document.onclick = setlists;
function setlists() {
if(parent.frames.left.document.f.rad[0].checked) setlist0();
if(parent.frames.left.document.f.rad[1].checked) setlist1();
}
function setlist0() {
with ( document.f.s.options[0] ) {
selected=true; text="Select item..."; value="";
}
with ( document.f.s.options[1] ) {
text="Item 1a"; value="";
}
with ( document.f.s.options[2] ) {
text="Item 1b"; value="";
}
with ( document.f.s.options[3] ) {
text="Item 1c"; value="";
}
}
function setlist1() {
with ( document.f.s.options[0] ) {
selected=true; text="Select item..."; value="";
}
with ( document.f.s.options[1] ) {
text="Item 2a"; value="";
}
with ( document.f.s.options[2] ) {
text="Item 2b"; value="";
}
with ( document.f.s.options[3] ) {
text="Item 2c"; value="";
}
}
//-->
</script>
</HEAD>
<BODY>
<form name="f">
<input type="radio" name="rad" onclick="setlists()">
List 1<BR>
<input type="radio" name="rad" onclick="setlists()">
List 2<BR><BR>
<select name="s">
<option value="" selected>Select list</option>
<option value=""></option>
<option value=""></option>
<option value=""></option>
</select><BR><BR>
</form>
</BODY>
</HTML>
toggle2.html
<form name="f">
<input type="radio" name="rad">
List 1<BR>
<input type="radio" name="rad">
List 2<BR><BR>
</form>
(Sorry - couldn't work out how to attach the files!)
rincewind
11-28-2003, 03:54 PM
cheers claire,
thanks for that,
i got it up and running already though just using action='' and target='' so i'm happy but thanks for your help 2