Javascript question ...

Results 1 to 6 of 6

Thread: Javascript question ...

  1. #1
    Noah Guest

    Default Javascript question ...

    Using the following code, I keep getting errors that the object doesn&#039t exist ... can anyone help?<BR><BR>"Error: &#039document.form.List1&#039 is not an object."<BR><BR>IT SEEMS TO WORK WITH ONLY ONE LIST BOX but not with 2.<BR><BR>&#060;script language="JavaScript"&#062;<BR>&#060;!--<BR>function SelectIt1(){<BR> if (document.form.List1.Select.options[document.form.List1.Select.selectedIndex].value != "none"){ <BR> location = document.form.List1.Select.options[document.form.List1.Select.selectedIndex].value} <BR>}//--&#062;<BR>&#060;/script&#062;<BR><BR><BR>.<BR>.<BR>.<BR>&#060;form name="Links" method="POST" action="--WEBBOT-SELF--"&#062;<BR>&#060;!--webbot bot="SaveResults" U-File="../_private/form_results.txt" S-Format="TEXT/CSV" S-Label-Fields="TRUE" --&#062;<BR>&#060;p&#062;<BR>&#060;select name="List1" onChange="SelectIt1()" size="1"&#062;<BR>&#060;option selected&#062;Dress Me...&#060;/option&#062;<BR>&#060;option value="celebrates.htm"&#062;Celebrates&#060;/option&#062;<BR>&#060;option value="garden.htm"&#062;Garden&#060;/option&#062;<BR>&#060;option value="dressme.htm"&#062;Dress Me&#060;/option&#062;<BR>&#060;option value="fifties.htm"&#062;Fabulous Fifties&#060;/option&#062;<BR>&#060;option value="stage.htm"&#062;On Stage&#060;/option&#062;<BR>&#060;option value="century.htm"&#062;Ginny Century&#060;/option&#062;<BR>&#060;option value="school.htm"&#062;School Days&#060;/option&#062;<BR>&#060;option value="travels.htm"&#062;Ginny Travels&#060;/option&#062;<BR>&#060;option value="towncountry.htm"&#062;Town &amp; Country&#060;/option&#062;<BR>&#060;option value="cooks.htm"&#062;Ginny Cooks&#060;/option&#062;<BR>&#060;option value="circus.htm"&#062;Little Circus&#060;/option&#062;<BR>&#060;option value="stuffies.htm"&#062;Stuffies&#060;/option&#062;<BR>&#060;/select&#062;<BR><BR>&#060;select name="List2" onChange="SelectIt2()" size="1"&#062;<BR>&#060;option value="none" selected&#062;Go to...&#060;/option&#062;<BR>&#060;option value="dressme/international.htm"&#062;International&#060;/option&#062;<BR>&#060;option value="dressme/fasion.htm"&#062;Fasion&#060;/option&#062;<BR>&#060;option value="dressme/active.htm"&#062;Active Wear&#060;/option&#062;<BR>&#060;option value="dressme/sweetheart.htm"&#062;Sweetheart&#060;/option&#062;<BR>&#060;/select&#062;<BR><BR>I would appreciate any help that anyone can give... Thanks!

  2. #2
    Join Date
    Dec 1969
    Posts
    119

    Default RE: Javascript question ...

    Use<BR>dcoument.from.List1.options<BR>Remove (Select) from the expression.<BR><BR>Manish

  3. #3
    Noah Guest

    Default RE: Javascript question ...

    Manish,<BR><BR>I appreciate your quick response. However I am still getting the same error ...<BR><BR>&#039Error: document.form.List1 is not an object&#039<BR><BR>Could it be because there are two list boxes? HELP!

  4. #4
    Join Date
    Dec 1969
    Posts
    119

    Default RE: Javascript question ...

    Sorry I forgot one thing. I tried the follwing code. It works.<BR>(Replace "form" with the form name)<BR><BR><BR>function SelectIt1(){<BR> if<BR> (document.Links.List1.options[document.Links.List1.selectedIndex].value<BR> != "none"){ <BR> document.location = document.Links.List1.options[document.Links.List1.selectedIndex].value}<BR><BR> }//--&#062;


  5. #5
    Noah Guest

    Default RE: Javascript question ...

    Thanks Manish! Worked like a charm!<BR><BR>You&#039re a life saver ...

  6. #6
    Noah Guest

    Default RE: Javascript question ...

    Thanks Manish! Worked like a charm!<BR><BR>You&#039re a life saver ...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •