Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Relative urls in dropdown lists ?

Posted on 2000-04-28
68
Medium Priority
?
434 Views
Last Modified: 2013-12-24
I am trying to use relative urls in a dropdown list using java. Can somebody take a look at my html and tell me why the relative urls do not work but the actual hardcoded ones do? This is being done in frontpage 2000.

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Shared Top Border</title>
<meta name="Microsoft Border" content="none">
</head>

<body>

<div align="center">
  <center>

<table border="0" cellspacing="0" cellpadding="0" width="630">
  <tr>
    <td align="center"><p align="center"><a href="../"><img src="../images/rexlogo.gif" alt="Rex Home Page" border="0" width="84" height="95"></a></td>
    <td width="410" align="center"><p align="center"><big><strong><big><big><big>Rex Dive
    Center</big></big></big></strong></big><br>
    <strong>Norwalk, CT 06854&nbsp; <img src="../images/flag_bullets.gif" alt="flagbull.gif (201 bytes)" width="12" height="12">&nbsp;
    1-888-260-DIVE<br>
    </strong><img src="../images/bluewave.gif" alt="Dive under the waves at Rex Dive Center" align="center" width="377" height="20"></td>
    <td align="center"><p align="center"><a href="http://www.islandprincess.com"><img src="../images/cruise_button.gif" width="90" height="90" alt="Island Princess. available for Charters !!" border="0"></a></td>
  </tr>
</table>
  </center>
</div>

<div align="center">
  <center>
  <table border="0" width="632">
    <tr>
      <td width="181" align="center">
        <form method="POST" name="navTest" action="../--WEBBOT-SELF--" onSubmit="" target="_top">
          <p align="center"><select size="1" onchange="window.open(this.options[this.selectedIndex].value,'_top')" name="dropdown">
          <option selected>Navigate Site .....</option>
          <option value="http://www.rexdivecenter.com/">Home Page</option>
          <option value="/staff.htm">Staff Page Relative</option>
          <option value="http://www.rexdivecenter.com/staff.htm">Staff Page URL</option>
          <option value="http://www.rexdivecenter.com/construction.htm">Construction</option>
          &nbsp;
          </select></p>
          <input type="hidden" name="Home" value="http:\\www.rexdivecenter.com">
        </form>
      </td>
      <td width="191" align="center">
        <form method="POST" action="../--WEBBOT-SELF--" name="GearForm" onSubmit="" target="_top">
          <p><select size="1" onchange="window.open(this.options[this.selectedIndex].value,'_top')" name="DiveGear">
            <option selected>Dive Gear......</option>
            <option value="http://www.rexdivecenter.com/equipment/bc_s/bc_info.htm">Bouyancy
            Compensators</option>
            <option value="http://www.rexdivecenter.com/equipment/dive_computers/computer_prices.htm">Dive
            Computers</option>
          </select></p>
        </form>
      </td>
      <td width="194" align="center">
        <form method="POST" name="trainform" target="_top">
          <p><select size="1" onchange="window.open(this.options[this.selectedIndex].value,'_top')" name="training">
            <option selected>Dive Training......</option>
            <option value="http://www.rexdivecenter.com/training/open_water.htm">Open
            Water Diver</option>
            <option value="http://www.rexdivecenter.com/training/advanced.htm">Advanced
            &quot;Deluxe&quot;</option>
            <option value="http://www.rexdivecenter.com/training/drysuit.htm">Drysuit
            Diver</option>
          </select></p>
        </form>
      </td>
    </tr>
  </table>
  </center>
</div>

</body>

</html>
0
Comment
Question by:DavidNPD
  • 44
  • 24
68 Comments
 

Author Comment

by:DavidNPD
ID: 2762017
Adjusted points from 100 to 150
0
 
LVL 3

Expert Comment

by:fibdev
ID: 2762106
// Place this into the head of your pages ...

<script language="javascript">
<!--
//
// Dropdown menu auto navigate script
//
function menunav() {
var local= document.form1.site.options[document.form1.site.selectedIndex].value;
window.location.href= local;
}
-->
</script>



// this is how your form should look ...

<form method="POST" name="form1">
<p align="center">
<select name="site" size=1 onChange="javascript:menunav()">
<option selected>Navigate Site .....</option>
<option value="http://www.rexdivecenter.com/">Home Page</option>
<option value="/staff.htm">Staff Page Relative</option>
<option value="http://www.rexdivecenter.com/staff.htm">Staff Page URL</option>
<option value="http://www.rexdivecenter.com/construction.htm">Construction</option>
</select>
</p>
<input type="hidden" name="Home" value="http:\\www.rexdivecenter.com">
</form>


This uses javascript to handle the form so most browsers will support it.  I don't know what frontpage was trying to do with the form, but this will fix the problem.

Good Luck  :)
0
 

Author Comment

by:DavidNPD
ID: 2762503
Will I still be able to use frontpage to administer the form such as adding new items and such? Or will this make it an entirely html version that frontpage justs insertes as html.
0
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 

Author Comment

by:DavidNPD
ID: 2762504
Also I have several forms per page do I need to paste the upper script just once or for each form with the form name changed for each?
0
 
LVL 3

Expert Comment

by:fibdev
ID: 2762615
1) You can still use frontpage to edit it.

2) Just past the javascript into the head of all pages that use it (once per page).
0
 
LVL 3

Expert Comment

by:fibdev
ID: 2762618
heh, correction (spelling)

2) Just PASTE the javascript into the head of all pages that use it(once per page).
0
 
LVL 3

Expert Comment

by:fibdev
ID: 2762630
When you use this script in other pages, pay close attention to this line:

var local= document.form1.site.options[document.form1.site.selectedIndex].value;

========================================================================================

This is why:

var local= document.FORM1.SITE.options

the script is looking for a form called form1 and an option list called site

same for this section of the same line:

[document.FORM1.SITE.selectedIndex].value;


To correct myself:

You will have to paste the script into your page One script for each form.

Name the form name accordingly, but to save yourself the hassel, always call the option list "SITE".

Good Luck  :)
0
 
LVL 3

Expert Comment

by:fibdev
ID: 2762675
Here ...

Use this script and you only have to put into the head of each document once.  It's easy to modify to suit the number of forms on your page!


<script language="javascript">
<!--
//
// Dropdown menu auto navigate script
//
function menunav() {

// ================================
// modify this to specify the number
// of forms on the page and the names
// of those forms
var N
var forms = new Array(N);
  forms[0]="form1";
  forms[1]="form2";
  forms[3]="form3";
// ================================

var local= document.forms(N).site.options[document.forms(N).site.selectedIndex].value;
window.location.href= local;
}
-->
</script>


and do your forms like this:


<form method="POST" name="form(0)">
<p align="center">
<select name="site" size=1 onChange="javascript:menunav()">
<option selected value="">Navigate Site .....</option>
<option value="http://www.rexdivecenter.com/">Home Page</option>
<option value="/staff.htm">Staff Page Relative</option>
<option value="http://www.rexdivecenter.com/staff.htm">Staff Page URL</option>
<option value="http://www.rexdivecenter.com/construction.htm">Construction</option>
</select>
</p>
<input type="hidden" name="Home" value="http:\\www.rexdivecenter.com">
</form>
<hr>
<form method="POST" name="form(1)">
<p align="center">
<select name="site" size=1 onChange="javascript:menunav()">
<option selected value="">Navigate Site .....</option>
<option value="http://www.rexdivecenter.com/">Home Page</option>
<option value="/staff.htm">Staff Page Relative</option>
<option value="http://www.rexdivecenter.com/staff.htm">Staff Page URL</option>
<option value="http://www.rexdivecenter.com/construction.htm">Construction</option>
</select>
</p>
<input type="hidden" name="Home" value="http:\\www.rexdivecenter.com">
</form>

Notice I added a value of "" to the option "Navigate Site ..."

I did this because it was producing an error when you clicked it before.


Hope this is what you need.

:)
0
 

Author Comment

by:DavidNPD
ID: 2762687
This is great, let me work on it and I will get right back to you, I used your previous one and it was working just like I wanted except I was having trouble with the multiple forms on one page. I was coming back to ask you a question but I think you answered it before I asked !!
0
 

Author Comment

by:DavidNPD
ID: 2762727
Adjusted points from 150 to 175
0
 

Author Comment

by:DavidNPD
ID: 2762728
I am having a little difficulty with this script. I have set up the 2 forms as you wrote, if form 1 has nothing selected and I select something from form 2 the browser goes to the root directory of where the current page is located in explorere mode. If there is somelthing selected in Form 1 and I then go and select something in form 2 I am brought to th eselection of form 1. Any ideas on this?

Here is the html:<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Shared Top Border</title>
<meta name="Microsoft Border" content="none">

<script language="javascript">
<!--
//
// Dropdown menu auto navigate script
//
function menunav() {

// ================================
// modify this to specify the number
// of forms on the page and the names
// of those forms
var N
var forms = new Array(N);
forms[0]="form1";
forms[1]="form2";
forms[3]="form3";
// ================================

var local= document.forms(N).site.options[document.forms(N).site.selectedIndex].value;
window.location.href= local;
}
-->
</script>  

</head>

<body>



<div align="center">
  <center>
  <table border="1" width="100%">
    <tr>
      <td width="33%"><form method="POST" name="form(0)">
<p align="center">
<select name="site" size=1 onChange="javascript:menunav()">
<option selected value="">Navigate Site .....</option>
<option value="http://www.rexdivecenter.com">Home Page</option>
<option value="../staff.htm">Staff Page</option>
<option value="../construction.htm">Construction</option>
<option value="../Equipment/equipment.htm">Equipment</option>
</select>
</p>
<input type="hidden" name="Home" value="<http:\\www.rexdivecenter.com>">
</form></td>
      <td width="33%"><form method="POST" name="form(1)">
<p align="center">
<select name="site" size=1 onChange="javascript:menunav()">
<option selected>Dive Gear Menu.....</option>
<option value="../equipment/equipment.htm">Equipment Page</option>
<option value="../equipment/bc_s/bc_info.htm">BC's</option>
</select>
</p>
<input type="hidden" name="Home" value="<http:\\www.rexdivecenter.com>">
</form>
</td>
      <td width="34%">Cell 3</td>
    </tr>
  </table>
  </center>
</div>

</body>

</html>


0
 

Author Comment

by:DavidNPD
ID: 2762744
Also what does the "hidden selection" do and should I remove the < > surrounding it. I needed to do this to the other urls to get them to work. I think they were added during the cutting and pasting?
0
 
LVL 3

Expert Comment

by:fibdev
ID: 2762800
Try removing this whole thing ...

I think It just got caught up in the copy and pasting when I was getting the form information for your script.

If you notice bugs, put it back, but I don't think you need it.

:)
0
 

Author Comment

by:DavidNPD
ID: 2762852
Do you think the Hidden Selection is causing my other problem?
0
 
LVL 3

Expert Comment

by:fibdev
ID: 2762855
It could be what is causing your problem ...

Try removing the whole tag and see if the script behaves better.

Also ...

try the script like this:

<script language="javascript">
<!--
//
// Dropdown menu auto navigate script
//
var N
var forms = new Array(N);
//
function menunav() {
// ================================
// modify this to specify the number
// of forms on the page and the names
// of those forms
forms[0]="form1";
forms[1]="form2";
forms[3]="form3";
// ================================

var local= document.forms(N).site.options[document.forms(N).site.selectedIndex].value;
window.location.href= local;
}
-->
</script>  

0
 

Author Comment

by:DavidNPD
ID: 2762881
I have to go out for a bit I will try it a little later, I did remove the hidden section part and it is still having that mentioned behaviour, going to whaterver is selected in form1. I will try your latest and let you know. Thanks for the continuing help.
Dave
0
 

Author Comment

by:DavidNPD
ID: 2762890
Adjusted points from 175 to 200
0
 

Author Comment

by:DavidNPD
ID: 2762891
No, this new code still does the same thing, any ideas why it would. I cant even begin to debug it, though I am learning.
0
 

Author Comment

by:DavidNPD
ID: 2762904
No, this new code still does the same thing, any ideas why it would. I cant even begin to debug it, though I am learning.
0
 

Author Comment

by:DavidNPD
ID: 2762909
This is the current code having the problem..<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Shared Top Border</title>
<meta name="Microsoft Border" content="none">

<script language="javascript">
<!--
//
// Dropdown menu auto navigate script
//
var N
var forms = new Array(N);
//
function menunav() {
// ================================
// modify this to specify the number
// of forms on the page and the names
// of those forms
forms[0]="form1";
forms[1]="form2";
forms[3]="form3";
// ================================

var local= document.forms(N).site.options[document.forms(N).site.selectedIndex].value;
window.location.href= local;
}
-->
</script>  

</head>

<body>

<div align="center">
  <center>
  <table border="1" width="100%">
    <tr>
      <td width="33%"><form method="POST" name="form(0)">
<p align="center">
<select name="site" size=1 onChange="javascript:menunav()">
<option selected value="">Navigate Site .....</option>
<option value="http://www.rexdivecenter.com">Home Page</option>
<option value="../staff.htm">Staff Page</option>
<option value="../construction.htm">Construction</option>
<option value="../Equipment/equipment.htm">Equipment</option>
</select>
</p>
</form></td>
      <td width="33%"><form method="POST" name="form(1)">
<p align="center">
<select name="site" size=1 onChange="javascript:menunav()">
<option selected>Dive Gear Menu.....</option>
<option value="../equipment/equipment.htm">Equipment Page</option>
<option value="../equipment/bc_s/bc_info.htm">BC's</option>
</select>
</p>
</form>
</td>
      <td width="34%">Cell 3</td>
    </tr>
  </table>
  </center>
</div>

</body>

</html>

0
 
LVL 3

Expert Comment

by:fibdev
ID: 2762910
I'm working on a solution ...

are these drop-down menus on all the pages or do you have a navigation page?
0
 

Author Comment

by:DavidNPD
ID: 2763131
My plan is to have my top shared border contain three of these dropdowns. Using shared borders these will display on each of my pages. I then will make up several other pages that contain nothing but one of these forms, these single form pages will be inserted into other pages as "page includes" this will allow me to only edit a couple of pages while changing the navigation menus throughout the site. So I really only need to have one page that contains three forms and the rest will contain single forms. When a user views the page he may see 4-5 dropdowns but they are generated from seperate pages that are displayed as one (sort of frame like)

Thanks for the help, (this is going to be the basis for navigation throughout my site)
Dave
0
 
LVL 3

Expert Comment

by:fibdev
ID: 2763725
Ok,

I've got it.  I had to get help from another expert and guess what I found out!

I was making the script more complex than it had to be, and that was causing the problem.  So, here is the revised script:

<script language="javascript">
<!--
//
// Dropdown menu auto navigate script
//
// ================================
function menunav(form) {
var local= form.site.value;
window.location.href= local;
form.reset();  // you can remove this line if you want the
// dropdown menu to stay on the selected item
// but this may cause errors when you get to navigating the site.
}
-->
</script>

Call it like this:

<form method="POST">
<p align="center">
<select name="site" size=1 onChange="javascript:menunav(this.form)">
<option selected value="">Navigate Site .....</option>
<option value="http://fibdev.com">Home Page</option>
<option value="http://fibdev.com/products.htm">Product Index</option>
<option value="http://fibdev.com/developers.htm">Developers Tools</option>
<option value="http://fibdev.com/domain_check.htm">Domain Check</option>
</select>
</p>
</form>
0
 
LVL 3

Expert Comment

by:fibdev
ID: 2763730
just don't name the forms and use this in the select name: OnChange="javascript:menunav(this.form)"

You may be okay naming the forms, but with this script it's not needed, so you may be better off not doing so.

Good Luck :)
0
 

Author Comment

by:DavidNPD
ID: 2763901
fibdev, I hate to ask again but..

It seemed to be working well so I populated all of my dropdowns with my choices, upon a full test I found that there is a problem.
These 3 forms are in a page called top.htm. This page is used as the top shared border in the rest of the site. If i test the dropdowns using just the page top.htm it works fine, when i attempt to use it though as a shared border the dropdown does nothing. Is the problem that the script is in the border and not in the actual page that I am currently on?

Here is the current html that is doint it. This is the top.htm page which is used as the "top" shared border.

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Shared Top Border</title>

<script language="javascript">
<!--
//
// Dropdown menu auto navigate script
//
// ================================
function menunav(form) {
var local= form.site.value;
window.location.href= local;
form.reset(); // you can remove this line if you want the
// dropdown menu to stay on the selected item
// but this may cause errors when you get to navigating the site.
}
-->
</script>    

<meta name="Microsoft Border" content="none">
</head>

<body>

<div align="center">
  <center>

<table border="0" cellspacing="0" cellpadding="0" width="630">
  <tr>
    <td align="center">
      <p align="center"><a href="../"><img src="../images/rexlogo.gif" alt="Rex Home Page" border="0" width="84" height="95"></a></td>
    <td width="410" align="center">
      <p align="center"><big><strong><big><big><big>Rex Dive Center</big></big></big></strong></big><br>
      <strong>Norwalk, CT 06854&nbsp; <img src="../images/flag_bullets.gif" alt="flagbull.gif (201 bytes)" width="12" height="12">&nbsp;
      1-888-260-DIVE<br>
      </strong><img src="../images/bluewave.gif" alt="Dive under the waves at Rex Dive Center" align="center" width="377" height="20"></td>
    <td align="center">
      <p align="center"><a href="http://www.islandprincess.com"><img src="../images/cruise_button.gif" width="90" height="90" alt="Island Princess. available for Charters !!" border="0"></a></td>
  </tr>
</table>
  </center>
</div>
<div align="center">
  <center>
  <table border="0" width="630">
    <tr>
      <td width="33%" align="center"><form method="POST">
<p align="center">
<select name="site" size=1 onChange="javascript:menunav(this.form)">
<option selected>Main Menu........</option>
<option value="http://www.rexdivecenter.com">Rex Home Page</option>
<option value="../charters.htm">Dive Charters</option>
<option value="../directions.htm">Directions to Rex</option>
<option value="../marina.htm">Rex Marine Center</option>
<option value="../staff.htm">Staff Page</option>
<option value="../oyster_fest99.htm">Norwalk Oyster Festival</option>
<option value="../Services.htm">Services</option>
<option value="../table_of_contents.htm">Web Index</option>
<option value="../todays_tides.htm">Todays Local Tides</option>
<option value="../travel.htm">Dive Travel</option>
</select>
</p>
</form></td>
      <td width="33%" align="center"><form method="POST">
<p align="center">
<select name="site" size=1 onChange="javascript:menunav(this.form)">
<option selected>Equipment Menu........</option>
<option value="../equipment/bc_s/bc_info.htm">BC's</option>
<option value="../equipment/cameras/camera_info.htm">Underwater Cameras</option>
<option value="../equipment/dive_computers/dive_computer_info.htm">Dive
Computers</option>
<option value="../equipment/drysuits/drysuit_info.htm">Drysuits</option>
<option value="../equipment/fins/fins_info.htm">Dive/Snorkel Fins</option>
<option value="../equipment/gauges_consoles_info.htm">Gauges and Consoles</option>
<option value="../equipment/masks_info.htm">Masks and Snorkels</option>
<option value="../equipment/dive_lights/dive_light_info.htm">Dive Lights</option>
<option value="../equipment/regulator_info.htm">Regulators</option>
<option value="../equipment/wetsuits_info.htm">Wetsuits</option>
<option value="../equipment/equipment.htm">Full Equipment Page</option>
<option value="../equipment/inflatables.htm">Inflatable Boats</option>
</select>
</p>
</form>
</td>
      <td width="34%" align="center"><form method="POST">
<p align="center">
<select name="site" size=1 onChange="javascript:menunav(this.form)">
<option selected>Dive Training Menu.....</option>
<option value="../training/learn_dive.htm">Learn to Dive</option>
<option value="../training/open_water.htm">Open Water Diver</option>
<option value="../training/advanced.htm">Advanced Open Water</option>
<option value="../training/assist_instruct.htm">Assistant Instructor</option>
<option value="../training/checkouts.htm">Checkout Procedures</option>
<option value="../training/deep.htm">Deep Diver</option>
<option value="../Construction.htm">Construction</option>
<option value="../training/dan_o2_provider.htm">DAN O2 Provider</option>
<option value="../training/dive_master.htm">Dive Master</option>
<option value="../training/drysuit.htm">Drysuit Diver</option>
<option value="../training/flowchart.htm">PADI training flowchart</option>
<option value="../training/master_diver.htm">Master Diver</option>
<option value="../training/medic_1st_aid.htm">Medic 1st Aid</option>
<option value="../training/night_diver.htm">Night Diver</option>
<option value="../training/nitrox.htm">Nitrox Diver</option>
<option value="../training/photog.htm">Underwater Photog</option>
<option value="../training/refresher.htm">Refresher Course</option>
<option value="../training/rescue_diver.htm">Rescue Diver</option>
<option value="../training/schedule.htm">Class Schedules</option>
<option value="../training/sign_up_form.htm">Class Sign up form</option>
<option value="../training/snorkeling.htm">Snorkeling Discovery</option>
<option value="../training/wreck.htm">Wreck Diver</option>
</select>
</p>
</form></td>
    </tr>
  </table>
  </center>
</div>

</body>

</html>




0
 

Author Comment

by:DavidNPD
ID: 2763902
Adjusted points from 200 to 225
0
 
LVL 3

Expert Comment

by:fibdev
ID: 2763924
Hmm ...

Try it like this:

<script language="javascript">
<!--
//
// Dropdown menu auto navigate script
//
// ================================
function menunav(form) {
var local= form.site.value;
opener.location.href= local;
form.reset(); // you can remove this line if you want the
// dropdown menu to stay on the selected item
// but this may cause errors when you get to navigating the site.
}
-->
</script>    

0
 

Author Comment

by:DavidNPD
ID: 2763980
No luck that didnt help the page when it was in a border and even caused the page when it was opened solely to stop functioning. I am not even sure how to troublshoot it. Thanks for the help.
0
 
LVL 3

Expert Comment

by:fibdev
ID: 2764002
Ok,

show me how your page is set up.

Is it a frameset?

are you using Iframes?

understanding the layout of your page(s) will help troubleshoot this a great deal.

If you would rather take this to email you may send the html here: expert@fibdev.com

we'll get this worked out :)
0
 

Author Comment

by:DavidNPD
ID: 2764185
While I am not at work email is difficult, If we continue tomorrow I will switch to email. Take a look at my page at http://www.rexdivecenter.com. All of the pages on the site use a common upper and lower border. As you can see the upper border has two rows of button links. I want to change those to the 3 dropdowns that you have been designing. Those dropdowns will then be placed via the shared  borders throughout the site. This way as I need to add/change the menu I only need to change it on one border page and the changes are made to ALL the pages. I really want to avoid getting into frames, I believe using the shared borders will do the same for me without the disadvantages.
Dave
0
 
LVL 3

Expert Comment

by:fibdev
ID: 2764401
We'll get this sooner or later :)

Ok, I think I understand what your talking about, so let's give this a try:

<script language="javascript">
<!--
//
// Dropdown menu auto navigate script
//
// ================================
function menunav(form) {
var local= form.site.value + ' target="_self"';
location.href= local;
form.reset(); // you can remove this line if you want the
// dropdown menu to stay on the selected item
// but this may cause errors when you get to navigating the site.
}
-->
</script>      










0
 

Author Comment

by:DavidNPD
ID: 2764580
I tried this one, when I try to run it in just the top border page I get a "page not found" error. when I attempt to run it in a page with the shared border it doesnt do anything. The original code that I put up worked with the borders but not the relative urls. Is there any way we can use that to help troubleshoot? Is there something that frontpage changes to make the code work with shared Borders? I am going to grab a book on html to see if I can assist in this in any way. I am still pretty lost with what this code does.
0
 
LVL 3

Expert Comment

by:fibdev
ID: 2764611
Ok, I think we got it :) I hope!

Here is the script:

<script language="javascript">
<!--
//
// Dropdown menu auto navigate script
//
// ================================
function menunav(form) {
var local= form.site.value,target;
location.href= local;
form.reset(); // you can remove this line if you want the
// dropdown menu to stay on the selected item
// but this may cause errors when you get to navigating the site.
}
-->
</script>

and here is the form:

<form method="POST">
<p align="center">
<select name="site" size=1 onChange="javascript:menunav(this.form)" target="_top">
<option selected value="">Navigate Site .....</option>
<option value="http://www.rexdivecenter.com/">Home Page</option>
<option value="/staff.htm">Staff Page Relative</option>
<option value="http://www.rexdivecenter.com/staff.htm">Staff Page URL</option>
<option value="http://www.rexdivecenter.com/construction.htm">Construction</option>
</select>
</p>
</form>



I tested it and it worked for me, but I didn't use the shared borders, let me know how it goes.  
         
         
         
         








0
 

Author Comment

by:DavidNPD
ID: 2764649
Still does the same thing, when it is running as a single page it works great but when it is in a shared border the dropdowns dont activate anything. I did notice something that may be a clue. If I view my page with the shared borders and I view the source, it shows the form scripts that are in the top border but it DOES NOT show the javascript that is at the top (the autonavigate script). Could I be placing it in the wrong postion in my html page? I would think that it wouldnt woroki at all if it was in the wrong place though. Why would frontpage display the forms but not the javascript?
0
 

Author Comment

by:DavidNPD
ID: 2764650
Another Clue, it never works when I just choose preview from frontpage, I need to choose "preview in browser". If I just use the preview tab I get "page not found" errors.
0
 

Author Comment

by:DavidNPD
ID: 2764657
If I just open the actual top border page in "preview in browser" and then choose view source it DOES show the navigate javascript. I am really leaning towards this as the problem. When frontpage looks at the single border page it sees and uses the javascript, when it uses that page inside of another page for some reason it does not see the javascript and cannot use it.
0
 
LVL 3

Expert Comment

by:fibdev
ID: 2764753
You are using FrontPage 2000 right?

Let me have a quick look at fp and see if I can figure out what it's doing ...
0
 

Author Comment

by:DavidNPD
ID: 2764767
2000 correct, I also just put up another question asking why the source would nt show up in a shared border.
0
 
LVL 3

Expert Comment

by:fibdev
ID: 2764842
ok, I got it to work fine.  This is what I did:

Open the shared boarder in frontpage
  example: /_boarders/top.htm

add the forms as they are to the page and save the page.

<form method="POST">
<p align="center">
<select name="site" size=1 onChange="javascript:menunav(this.form)" target="_top">
<option selected value="">Navigate Site .....</option>
<option value="http://www.rexdivecenter.com/">Home Page</option>
<option value="/staff.htm">Staff Page Relative</option>
<option value="http://www.rexdivecenter.com/staff.htm">Staff Page URL</option>
<option value="http://www.rexdivecenter.com/construction.htm">Construction</option>
</select>
</p>
</form>


Then, place the script into all of the pages involved in the navigation:

<script language="javascript">
<!--
//
// Dropdown menu auto navigate script
//
// ================================
function menunav(form) {
var local= form.site.value,target;
location.href= local;
form.reset(); // you can remove this line if you want the
// dropdown menu to stay on the selected item
// but this may cause errors when you get to navigating the site.
}
-->
</script>

save the pages and it all should work fine.
0
 
LVL 3

Expert Comment

by:fibdev
ID: 2764850
Don't place the script into the shared boarder pages( "_boarders/top.htm" )!
0
 

Author Comment

by:DavidNPD
ID: 2764873
OK that is what I was beginning to get afraid of. That means about 140 pages I need to add this to. That is OK as long as I dont make any errors with it. My experience has been that I will screw something up and have to go back and change it later. That is why I was hoping to have it all on one page to share. Let me start working on that tonight and I will let you know how it goes.
0
 

Author Comment

by:DavidNPD
ID: 2764917
I must be a moron, I have left the forms as they are in the border page. I removed the script from the boarder page and put it into the head section of a bunch of my other pages. I go to preview them and I just get page not found errors ??????? Tomorrow I will start with clean empty pages and try it that way. I must be missing something. I will email you tomorrow. Thanks

davidwrinn@rexdivecenter.com
0
 
LVL 3

Expert Comment

by:fibdev
ID: 2764921
Make sure you save all the pages before you preview them.
0
 

Author Comment

by:DavidNPD
ID: 2764961
I have been, I am giving up for the night. I stripped my pages down to nothing except the script and forms. I have it working but I am back to square one with regular urls like http:\\www.fibdev.com working but not  relative urls like ../index.htm. I noticed one of your forms has your urls in it, does yours work with relatives or just with hardcoded urls to net sites?
0
 

Author Comment

by:DavidNPD
ID: 2764968
0
 
LVL 3

Expert Comment

by:fibdev
ID: 2765029
for relative urls, you would do it like this:

change this part of the script:

var local= form.site.value,target;

to this:

var local= 'http://' + form.site.value,target;

and change your form from this:

<option value="http://yourpage.com">

to this:

<option value="../myurl.htm">

Good Luck!

Sorry you've had such trouble with it.
0
 
LVL 3

Expert Comment

by:fibdev
ID: 2775118
Hey David,

How's it going?

Just wondering if you need more help or if you're ready to close out this quesion?

- Gabe
0
 

Author Comment

by:DavidNPD
ID: 2775236
Adjusted points from 225 to 250
0
 

Author Comment

by:DavidNPD
ID: 2775237
I tried the last code the other night and that still wasnt going. I had to go put it on the back burner till tonight and then I will be trying it again. This is a part time endeavor for me. I took some more days off to get this working I will get back to you tonight.
0
 

Author Comment

by:DavidNPD
ID: 2775297
Every time I attempt to use relative URLs my browser shows in the address bar http://../test1.htm  your script adds that in so that relatives are changed to full web addresses but how do we make it so that it doesnt place that there if it is not on the net? It doesnt seem to distinguish between relatives and net URLS.

Here is what is in the border page:
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Shared Top Border</title>

<meta name="Microsoft Border" content="none">
<form method="POST">
  </head>

<body>
<form method="POST">
<p align="center">
<select name="site" size=1 onChange="javascript:menunav(this.form)" target="_top">
<option selected value="">Navigate Site .....</option>
<option value="http://www.rexdivecenter.com/">Home Page</option>
<option value="../test1.htm">Test1</option>
<option value="../test2.htm">test2</option>
<option value="../test3.htm">Test3</option>
</select>
</p>
</form>
</body>

</html>

and here is what is in eacfh of the test pages, I have this stripped down as far as I can go I am sure I am missing something simple.<html>

<head>
<script language="javascript">
<!--
//
// Dropdown menu auto navigate script
//
// ================================
function menunav(form) {
var local= 'http://' + form.site.value,target;
location.href= local;
form.reset(); // you can remove this line if you want the
// dropdown menu to stay on the selected item
// but this may cause errors when you get to navigating the site.
}
-->
</script>


<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>New Page 1</title>



<meta name="Microsoft Border" content="t">
</head>

<body>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>This is test page #1</body>

</html>
 After all this code swapping are we both looking at the same thing? I have also found that during my cutting and pasting that I an getting <> surrounding some of you code usually around urls and http lines.

0
 

Author Comment

by:DavidNPD
ID: 2775618
Every time I attempt to use relative URLs my browser shows in the address bar http://../test1.htm  your script adds that in so that relatives are changed to full web addresses but how do we make it so that it doesnt place that there if it is not on the net? It doesnt seem to distinguish between relatives and net URLS.

Here is what is in the border page:
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Shared Top Border</title>

<meta name="Microsoft Border" content="none">
<form method="POST">
  </head>

<body>
<form method="POST">
<p align="center">
<select name="site" size=1 onChange="javascript:menunav(this.form)" target="_top">
<option selected value="">Navigate Site .....</option>
<option value="http://www.rexdivecenter.com/">Home Page</option>
<option value="../test1.htm">Test1</option>
<option value="../test2.htm">test2</option>
<option value="../test3.htm">Test3</option>
</select>
</p>
</form>
</body>

</html>

and here is what is in eacfh of the test pages, I have this stripped down as far as I can go I am sure I am missing something simple.<html>

<head>
<script language="javascript">
<!--
//
// Dropdown menu auto navigate script
//
// ================================
function menunav(form) {
var local= 'http://' + form.site.value,target;
location.href= local;
form.reset(); // you can remove this line if you want the
// dropdown menu to stay on the selected item
// but this may cause errors when you get to navigating the site.
}
-->
</script>


<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>New Page 1</title>



<meta name="Microsoft Border" content="t">
</head>

<body>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>This is test page #1</body>

</html>
 After all this code swapping are we both looking at the same thing? I have also found that during my cutting and pasting that I an getting <> surrounding some of you code usually around urls and http lines.

0
 

Author Comment

by:DavidNPD
ID: 2775620
ooops didnt realize refreshing the page woudl do that.
0
 
LVL 3

Expert Comment

by:fibdev
ID: 2775644
Ok,

We have a couple of options here ...

I assume you want the script to work with relative url's so that you can quickly edit the pages in frontpage and be done with them.

1) We can set FrontPage so that it uses full url's when creating links so that you won't be using reletive urls at all.

2) We can addapt the script to resolve the local host and hope that it's going to work with most browsers.
0
 

Author Comment

by:DavidNPD
ID: 2775770
OK let me think about this, I really need to do a big redesign so I am worried about not being able to test them but I also need to be assured that this is going to work in most browsers.
0
 

Author Comment

by:DavidNPD
ID: 2776710
OK I think I have this working, but there is a strange behaviour that I dont understand. The only way I can get my relative urls to work is to use them with a single period not two like expected is this an indication of someithign amiss? They need to be like this: <option value="./test3.htm">Test3</option>    as opposed to like this <option value="../test3.htm">Test3</option> or they dont work.
0
 

Author Comment

by:DavidNPD
ID: 2776778
Would this also explain why I cannot use teh preview tab in frontpage? The dropdowns only work if I use them from preview in browser, I get page not found errors if I go from the tab.
0
 

Author Comment

by:DavidNPD
ID: 2776949
There is definetley something strange going on with this script. I just started to install it into my 160+ pages and realized that it does work for my top level pages but any page deeper into the structure does not work. I have found that any options that are like this  <option value="./equipment/wetsuits/wetsuits_info.htm">Wetsuits</option>  do not work. Where as if it was like this <option value="./equipment/wetsuits_info.htm">Wetsuits</option> they would work. I am able to use the dropdown to navigate to them but if I then attempt to use the dropdown to navigate away from then they do not work except for a hardcoded url. This is what I am worried about, changing 160 pages and then realizing later that I need to change all of them. Any idea what would cause this?
0
 

Author Comment

by:DavidNPD
ID: 2777016
Here is what I would like to do, I dont know if we can but.... I would like to set up the scripts on each page so that they will work with relative urls. I will then place that script on each page. After I finish redesigning the web I will use the Frontpage "Find/Replace" command to do a entire site replace of the relative url code and replace it with static url code. Then I can uplaod the site and it will hopefully work with all browsers. I think the hitch is that the replace command doesnt work with entire lines of code just single words, is there any way around that?
0
 
LVL 3

Expert Comment

by:fibdev
ID: 2778779
There is definetley something strange going on with this script. I just started to install it into my 160+ pages and realized that it does work for my top level pages but any page deeper into the structure does not work. I have found that any options that are like this  <option value="./equipment/wetsuits/wetsuits_info.htm">Wetsuits</option>  do not work. Where as if it was like this <option value="./equipment/wetsuits_info.htm">Wetsuits</option> they would work. I am able to use the dropdown to navigate to them but if I then attempt to use the dropdown to navigate away from then they do not work except for a hardcoded url. This is what I am worried about, changing 160 pages and then realizing later that I need to change all of them. Any idea what would cause this?


This sounds like you are switching to a different shared boarder.  If that's the case, the script needs to be modified for that boarder because it is targeting the url's to ="_top"  Maybe this part of the url should be left out of the script and placed into the option on the form....

<option value="http://www.myserver.com/subdir/index.htm target="_whatevertarget">Option 1</option>
0
 

Author Comment

by:DavidNPD
ID: 2778866
I am only using one top boarder, actually I dont think frontpage can use more than one. I am concerned that the Relatives need a single period as opposed to two, it indicates that frontpage is not resolving them correctly. You had this working in a frontpage web did it work with double periods and also to pages below the first level?
0
 

Author Comment

by:DavidNPD
ID: 2779190
I just tried another Idea, I put all of the code in a new page with the three dropdowns and then used Frontpages "include page" feature to put that page in each of my pages similar to shared borders. NO GOOD the include doesnt actually place the code in the page just inserts a type of link to it.
Any other ideas on how to get this to work or should I scrap the idea and go a different direction?
0
 

Author Comment

by:DavidNPD
ID: 2779236
OK I think I am making progress. I put your little javascript code in each page. I then place the forms into a page that is inserted into each page using "Frontpage Insert Command" It will work with Static URLS but not Relatives....... Should I just say the heck with it and go Static? I am still very worried about not being able to fix any code problem without edited 160 pages.
0
 

Author Comment

by:DavidNPD
ID: 2779261
I just found another strange thing about Frontpage, sometimes when I edit the page for some table formattting for instance it removes some of the HTML tags. specifically it is removing the <form/> tag that is after each form on the page. If I put it back in it works ?
0
 
LVL 3

Accepted Solution

by:
fibdev earned 750 total points
ID: 2779267
Yeah,

I know what you mean.  160+ is a lot of editing, but any way you slice it ...  you will have to do a lot of editing no matter what if you're talking about that big of a site.

The choice is up to you, but being a MCP and having access to the Microsoft Certified Professional technet knowlage base, I still can't find any documentation on this relative url business, other than what I already know.  when you edit a url, select the page from the list to create a relative link, or just type in the relative link.  There is no information on relative links other than that and no documentation about converting links to static.  All I've found on this is: edit the hyperlink by right-clicking on it, type in the full path to create a static link.

*shrug*
I wish we could come up with a better solution.
0
 
LVL 3

Expert Comment

by:fibdev
ID: 2779275
I just found another strange thing about Frontpage, sometimes when I edit the page for some table formattting for instance it removes some of the HTML tags. specifically it is removing the <form/> tag that is after each form on the page. If I put it back in it works ?

This is probably a bug because a form should not be an open-ended tag.
0
 

Author Comment

by:DavidNPD
ID: 2780441
I thought I had this working last night. I start working on it again this morning and one dropdown that worked yesterday doesn't todany an vice versa. This is too inconsistent for me to take a chance on my whole site, I think I really need to take a different course I just dont know what yet.
0
 

Author Comment

by:DavidNPD
ID: 2780610
OK I think I have it. I used some of the old code that I had. This works WITHOUT any code needed on the individual pages I just need the code in ond page that is inserted. Take a look at some test pages I put up at http://rexdivecenter.com/test1.htm  only go from each of the dropdowns to any of the three test pages.

Thank you for all the work I really appreaciate it.
0
 

Author Comment

by:DavidNPD
ID: 2780621
Though we did not figure out how to use Relative urls along with static, we made a lot of progress and FibDev was an excellent source of info.
0

Featured Post

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When deciding to adopt any help desk solutions many factors should be explored before taking decisions. This will change from business to another but in general there are some kind of rule of thumb. Here are some quick tips: Do we need only ticket…
This article provides a case study on how our local youth baseball league deployed a new website, including the platform selection, implementation and benefits to the league.
The purpose of this video is to demonstrate how to integrate Mailchimp with WordPress, by placing a Mailchimp signup form on a WordPress Page or Post. This will be demonstrated using a Windows 8 PC. Mailchimp will be used. Log into your Mailchi…
The purpose of this video is to demonstrate how to set up basic WordPress SEO. This will be demonstrated using a Windows 8 PC. The plugin used will be WordPress SEO by Yoast. Go to your WordPress login page. This will look like the following: myw…

972 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question