
Originally Posted by
darco9x2
<SCRIPT LANGUAGE="javascript">
The language attribute has been deprecated for over six years. Use the (required) type attribute instead:
HTML Code:
<script type="text/javascript">
function LinkUp()
{
var number = document.DropDown.DDlinks.selectedIndex;
location.href = document.DropDown.DDlinks.options[number].value;
}
Here you attempt to reference a the form with the identifier DropDown, however no such element exists. The quick fix would be to give the form the right name, however there's a better way.
<center><h4>The Fish<hr width=30%></h4></center>
Don't skip heading levels just because they aren't the right size. You have a stylesheet so use it. The following mark-up and CSS should be equivalent (including the line breaks).
HTML Code:
<h1>The Fish<hr></h1>
Code:
body {
font-size: 100%;
}
h1 {
font-size: 105%;
margin-bottom: 2.5em;
text-align: center;
}
h1 hr {
width: 30%;
}
Now for the drop-down navigation list:
HTML Code:
<form action="" onsubmit="return false;">
<select name="links" size="1">
<option value="" selected>--> Choose a link <--</option>
<!-- Other options -->
</select>
<input type="submit" value="Go!" onclick="goTo(this);">
</form>
Notice that the initial option has an explicit empty string as its value.
Code:
function goTo(btn) {var links = btn.form.elements['links'], link;
if((link = links.options[links.selectedIndex].value)) {
location = link;
}
}
Preferably, the form would submit to a redirection script on the server that would provide a fallback if a user had Javascript disabled.
its the form part, jsut ignore the rest.
I'm glad. It's a little too late to delve into the rest of it.
By the way, could you please use the [code] or [html] pseudo-tags when posting code and properly indent any scripts. They're a lot more readable that way.
Mike
Bookmarks