Click to See Complete Forum and Search --> : 2 frame value passing?


mcuk
01-27-2003, 05:39 AM
Can someone help me?

I have two frames, a navigation frame and a display frame.

In the left frame, there are options which change dependant on which section the user is in.
Eg.
Nav Page 1 - Options: Home, Page 1, Page 2.
Nav Page 2 - Options: Home, Page 2-1, Page 2-2....

These options then control content in Frame 2.

All sections link to the 1 enquiries form which contains a dropdown list of all the sections in the site.

How do i make this dropdown auto select which section the user came from?

mcuk
01-27-2003, 08:39 AM
var p = parent;
var d = document;
var refPage = p.nav_frame.document.URL.toString();
var cutVersion = refPage.slice(refPage.lastIndexOf('/'),refPage.lastIndexOf('.'));

function alterDrop(enquiries)
{
switch (cutVersion)
{
case "dir_nav" :
d.enquiries.requiredsubject.value = "directorate";
break;
case "pro_nav" :
d.enquiries.requiredsubject.value = "projects";
break;
case "fac_nav" :
d.enquiries.requiredsubject.value = "facilities";
break;
default :
d.enquiries.requiredsubject.value = "general";
}
}


This is my external code called 'decider.js' and i call it from my enquiries form using this inside the body tags:

onLoad="alterDrop(enquiries)"

But it doesnt work for some reason. I've tested the slice etc to make sure none of that is the problem, but it looks like my code isnt altering my dropdown box to reflect the section.

Help?

mcuk
01-28-2003, 03:39 AM
sorry, i should have written these out for your reference:

my form is called - enquiries
my dropdown box is - requiredsubject

what i want is for the top bit of code to slice the nav_frame URL to just its simplest form, which would be 'home_nav' or 'dir_nav' etc and then depending on that, the dropdown in my form would select upon entering the page, which subject corresponds.

eg.
dir_nav = option directorate
pro_nav = option projects

Does this help more?