It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming JavaScript Forum

faulty jump menu

faulty jump menu

Postby andy_bradley on Thu Apr 02, 2009 9:18 am

could someone tell me why this code does not work please. cheers

</html>
<head>

<script language="javascript"
type="text/javascript">function "jumpto"(x)(document.location.href=x)
</script>


</head>
<body>

<form name="form1">
<select name="jumpmenu"
onchange ="jumpto (document.form1.jumpmenu.options[document.form1.jumpmenu.options.selectedindex].value)">

<option>jump to...</option>
<option value="tuesday.html">tuesday</option>
<option value="wednesday.html">wednesday</option>
<option value="thursday.html">thursday</option>
<option value="friday.html">friday</option>
<option value="saturday.html">saturday</option>
<option value="sunday.html">sunday</option>
</select>
</form>

</body>
</html>
andy_bradley
 
Posts: 2
Joined: Thu Apr 02, 2009 8:50 am

Re: faulty jump menu

Postby Suffer on Wed Apr 08, 2009 8:01 am

i dont see any errors. all tegs have begin and end... :?: :!: :idea: :?
Suffer
100+ Club
 
Posts: 236
Joined: Tue Jan 20, 2009 6:34 am

Re: faulty jump menu

Postby rangana on Wed Apr 08, 2009 8:07 am

Suffer wrote:i dont see any errors. all tegs have begin and end... :?: :!: :idea: :?


The issue is not because of the tags, in fact, the tags are erroneous due to the deprecated language attribute on the script tag.

@andy,

The passed argument on your onchange event is unnecessary, which could be rectified into:
Code: Select all
<select name="jumpmenu" onchange ="jumpto (this.value)">


Aside from that, replace your script with:
Code: Select all
<script type="text/javascript">
function jumpto(x) {
   location.href=x;
}
</script>


Hope that helps.
User avatar
rangana
500+ Club
 
Posts: 935
Joined: Wed Feb 27, 2008 5:14 am
Location: Cebu City Philippines

Re: faulty jump menu

Postby andy_bradley on Wed Apr 08, 2009 10:26 am

Alright thank you for the replies, Thats got it working cheers
andy_bradley
 
Posts: 2
Joined: Thu Apr 02, 2009 8:50 am


Who is online

Users browsing this forum: No registered users and 4 guests