frames - top frame to left frame - not loading attimes, 1st time works fine

frames - top frame to left frame - not loading attimes, 1st time works fine

Post by usdoll.. » Tue, 04 Jan 2000 04:00:00



hi

I have three frames, one main center,
one top, and one left frame.

I have two pulldown menus in the top frame.
When I change option in pulldown 1, pulldown 2 gets loaded.
And then I press go, a button, to load a specific page
in left frame.

This works fine, as long as I keep choosing or changing the options
in pulldown 2.

The moment I change the option in pulldown 1, I get a message,
page not found, in the left frame.

What could this be because of.

Thanks a lot for your help.

regards
babu

More Info,  code in the top frame.

<HTML>
<HEAD>

<script language="JavaScript">
stateOpt = new Array; //this array stores the main dropdown text
stateOpt[0] = "A";
stateOpt[1] = "B";
stateOpt[2] = "C";
stateOpt[3] = "D";
cityOpt = new Array; //this array stores the second dropdown text for
the first catagory
cityOpt[0] = "A1"
cityOpt[1] = "A2"
cityOpt[2] = "A3"
cityOpt[3] = "A4"
cityOpt[4] = "A5"
var trueLength = cityOpt.length; //stores how many options are
currently in the second dropdown
var lst = cityOpt.length; //stores how many options are currently in
the second dropdown

function newPageGet()
{
var choose1 = document.dropdown1.state.value;
var choose2 = document.dropdown1.city.value;
choose3 = choose1 + choose2 + ".htm";

parent.contents.location.href = choose3;

Quote:}

function changeMenu()
  {
  cityOpt.length = 0;
  menuNum = document.dropdown1.state.selectedIndex;
  //document.[Form Name].[Main Option Name].selectedIndex this grabs
the index of the selected option in the main dropdown
  /*
the next few if statements are based on the selected index of the main
dropdown.
the array stores the values of the second dropdown options that are
associated with the currently selected main dropdown
  */
  if (menuNum == null) return;
  if (menuNum == 0)
    {
    cityOpt = new Array;
    cityOpt[0] = new Option("A1");
    cityOpt[1] = new Option("A2");
    cityOpt[2] = new Option("A3");
    cityOpt[3] = new Option("A4");
    cityOpt[4] = new Option("A5");
    }
  if (menuNum == 1)
    {
    cityOpt = new Array;
    cityOpt[0] = new Option("B1");
    cityOpt[1] = new Option("B2");
    cityOpt[2] = new Option("B3");
    cityOpt[3] = new Option("B4");
    }

  tot = cityOpt.length;  //grabs how many options are now in the second
dropdown
  for (i = lst; i > 0; i--)
    {
    document.dropdown1.city.options[i] = null;
    /* document.[Form Name].[Select Name].options[i] this gets rid of
the secondary options */
    }
  for (i = 0; i < tot; i++)
    {
    document.dropdown1.city.options[i] = cityOpt[i];
    /* document.[Form Name].[Select Name].options[i] this puts the new
options in the menu */
    }

  document.dropdown1.city.options[0].selected = true;  //selects the
first option in the second dropdown
  lst = cityOpt.length;  //grabs how many options are now in the second
dropdown

Quote:}

</script>

</HEAD>
<BODY bgcolor="#FFCC66">

<FORM NAME="dropdown1" action="_vti_bin/shtml.exe/topFrame1.htm"
method="POST" onSubmit="" webbot-action="--WEBBOT-SELF--" >

<!--webbot bot="SaveResults" startspan U-File="formrslt.htm" S-
Format="HTML/DL"
B-Label-Fields="TRUE" --><input TYPE="hidden" NAME="VTI-GROUP"
VALUE="0"><!--webbot
bot="SaveResults" endspan i-checksum="43374" -->

<div align="right">
  <table border="0" width="100%" height="42" cellspacing="0"
cellpadding="0"  >

      <tr>
        <td width="20%"><select size="1" name="state"
onChange="changeMenu()" >
<OPTION value="A" SELECTED>A
<OPTION value="B">B
<OPTION value="C">C
<OPTION value="D">D

        </select></td>
      <td width="24%"><select size="1" name="city">
<OPTION value="A1" SELECTED>A1
<OPTION value="A2">A2
<OPTION value="A3">A3
<OPTION value="A4">A4
<OPTION value="A5">A5
        </select></td>
      <td width="12%"><input type="button" value="Go!"
onClick="newPageGet();" name="aButton"></td>
    </tr>
  </table>
</div>

</FORM>
</BODY>
</HTML>

Sent via Deja.com http://www.deja.com/
Before you buy.