FrontPage 2000 - value in drop-down box taking you to a web page

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Douglas47
    New Member
    • Aug 2015
    • 2

    FrontPage 2000 - value in drop-down box taking you to a web page

    I am using a drop-down box that FrontPage builds for you, as a drop down menu.

    Here is the code FrontPage creates (with values you insert):

    Code:
    <form method="POST" action="--WEBBOT-SELF--">
      <!--webbot bot="SaveResults"
      U-File="C:\Users\Douglas\Documents\Test Website\_private\form_results.txt"
      S-Format="TEXT/CSV" S-Label-Fields="TRUE" -->
      <p><select size="1" name="D1">
        <option value="page1.htm">web page 1</option>
        <option value="page2.htm">web page 2</option>
        <option value="page3.htm">web page 3</option>
      </select>
      <input type="submit" value="Submit" name="B1">
      <input type="reset" value="Reset" name="B2"></p>
     </form>
    What I want it to do is go to page1.htm when "web page 1" is selected, and the "submit" button is pressed, and likewise with the other pages.

    I am guessing it can be done with a series of "if" statements, a function inside each one, and included in that function would be: location.href =

    Can anyone tell me what code to use, and where to place it?

    Thanks,
    Douglas
    Last edited by Rabbit; Aug 28 '15, 05:04 PM. Reason: Please use [code] and [/code] tags when posting code or formatted data.
  • Douglas47
    New Member
    • Aug 2015
    • 2

    #2
    I finally figured it out. I guess not too many people still use FrontPage 2000!!!

    Anyway, here is the code I used, in case anyone is interested:

    Code:
    <html>
    
    
    <body>
    <p>Select a web page from the drop-down list.</p>
    
    <select id="mySelect" onchange="myFunction()">
      <option value="webpage 1">Web Page 1
      <option value="webpage 2">Web Page 2
      <option value="webpage 3">Web Page 3
    </select>
    
    <p>When you select a webpage, a function is triggered that takes you to that page.</p>
    
    
    
    <script>
    
    function myFunction() 
    {var x = document.getElementById("mySelect").value;
    if (x=="webpage 1") {
    location.href = "webpage 1.htm";
    } else if (x=="webpage 2") {
    location.href = "webpage 2.htm";
    } else {
    location.href = "webpage 3.htm";}
    
    }
    
    </script>
    
    
    </body>
    
    </html>

    Comment

    Working...