help with html code

would like to have code linked properly

Page 1 of 1

10 Replies - 2745 Views - Last Post: 17 October 2005 - 01:01 AM

#1 danlew  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 21
  • Joined: 10-October 05

help with html code

Posted 13 October 2005 - 10:37 PM

Its all looking good, i just need it to link to webpage sections, what do i need to add it and where do i add it? Thankyou

<script LANGUAGE="Javascript">

<!--

function leapto(form) {
var myindex=form.dest.selectedIndex
location.href=(form.dest.options[myindex].value);
}

// End -->

</script>
<form name="quicklinks">
<div align="center"><center><p><select NAME="dest"
style="BACKGROUND-COLOR: #DEDEDE; COLOR: #003366; FONT-FAMILY: Arial; SIZE=" 1"
onchange="leapto(this.form)" size="1">
<option selected>Quick Search:</option>
<option value="javascript.htm#Favorites">...Please select from list below</option>
<option value="javascriptonmouse.htm">...Accommodation</option>
<option value="javascriptonmouse.htm">...Alternative Lifestyles</option>
<option value="javascriptonmouse.htm">...Business & Finance</option>
<option value="javascriptonmouse.htm">...Club Sports & Rec</option>
<option value="javascriptonmouse.htm">...Computers & Tech</option>
<option value="javascriptonmouse.htm">...Education & Career</option>
<option value="javascriptonmouse.htm">...Entertainment</option>
<option value="javascriptonmouse.htm">...Golf</option>
<option value="javascriptonmouse.htm">...Health & Beauty</option>
<option value="javascriptonmouse.htm">...House & Garden</option>
<option value="javascriptonmouse.htm">...Industry & Develop</option>
<option value="javascriptonmouse.htm">...Internet/Hosting</option>
<option value="javascriptonmouse.htm">...Intros/Personal</option>
<option value="javascriptonmouse.htm">...Motoring</option>
<option value="javascriptonmouse.htm">...Media/Publishing</option>
<option value="javascriptonmouse.htm">...Office Needs</option>
<option value="javascriptonmouse.htm">...Professional Serv</option>
<option value="javascriptonmouse.htm">...Real Estate</option>
<option value="javascriptonmouse.htm">...Restaurants</option>
<option value="javascriptonmouse.htm">...Shop/Fashion/Arts</option>
<option value="javascriptonmouse.htm">...Tourist & Visitor</option>
<option value="javascriptonmouse.htm">...Transport</option>
</select></p>
</center></div>
</form>

This post has been edited by danlew: 13 October 2005 - 10:38 PM


Is This A Good Question/Topic? 0
  • +

Replies To: help with html code

#2 fyrestorm  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 10
  • View blog
  • Posts: 3,113
  • Joined: 04-April 02

Re: help with html code

Posted 13 October 2005 - 10:50 PM

I'm having a bit of a hard time trying to follow you. Can you please try to clarify what it is you're needing?

From what I see, the best answer I can give at this point is:
you can put the drop down box in a file of it's own and have an include in your script that would include it where you need it...

I'm not quite sure what the point of the javascript function is...
Was This Post Helpful? 0
  • +
  • -

#3 Israel  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 7
  • View blog
  • Posts: 818
  • Joined: 22-November 04

Re: help with html code

Posted 13 October 2005 - 11:11 PM

Ok, gotta go with fyrestorm on this. We need more details about what your trying to do. Your javascript box works fine, it just doesn't have options linked to a web server. That's the only thing I see wrong...but you may have already known that. (...that's why we need details.) But in case you didn't know that, you to replace all the C:\mydocuments\mypath\myfiles\ with www.myfile@myserver.com. So whatever those options in the box are supposed to go to need to get uploaded on your server or with your webhosting company and from there you need to change your code like I mentioned above. Hope that helped...

This post has been edited by Israel: 13 October 2005 - 11:13 PM

Was This Post Helpful? 0
  • +
  • -

#4 danlew  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 21
  • Joined: 10-October 05

Re: help with html code

Posted 14 October 2005 - 02:12 AM

Ok, My javascript box works fine, im aware of that, it just doesn't have options linked to a web server. Im also very aware of that, but where do i put the text to enable it to be linked to the webserver, should i add my web server address link in section (onchange="leapto(this.form)" size="1"> located below


<div align="center"><center><p><select NAME="dest"
style="BACKGROUND-COLOR: #DEDEDE; COLOR: #003366; FONT-FAMILY: Arial; SIZE=" 1"
onchange="leapto(this.form)" size="1">
eqample = MYWEBPAGES@WEB.COM
Was This Post Helpful? 0
  • +
  • -

#5 Israel  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 7
  • View blog
  • Posts: 818
  • Joined: 22-November 04

Re: help with html code

Posted 14 October 2005 - 05:24 AM

You need to embed your Javascript into your html code. Most often it goes in the head.

<head>
<title>title</title>
<script language = javascript>
Javascript code 
</script>
</head> 


But not always the case.

I ran your code like this though and it worked fine.

<html>
<head>
<title>title</title> 
</script>
</head>
<body>
<script language = javascript>
Javascript code
</script>
</body>
</html>
 


I'm guessing you probably knew this too. But the question is probably that you want to put this javascript box somewhere specific....right? I don't know if anyone is really going to be able to answer that for you without seeing the entire script for the page and/or getting specific detail on where you would want this to go on a page. Maybe this will help?

Or maybe this...

Even Better!

This post has been edited by Israel: 15 October 2005 - 01:49 AM

Was This Post Helpful? 0
  • +
  • -

#6 danlew  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 21
  • Joined: 10-October 05

Re: help with html code

Posted 15 October 2005 - 07:22 AM

Ok ill start my question again,
if i want section ACCOMMODATION to link to page
http://www.bigjohnsworld.com/

WHERE IN MY SCRIPT BELOW DO I ADD IT IN AND WHAT SECTION?

<script LANGUAGE="Javascript">

<!--

function leapto(form) {
var myindex=form.dest.selectedIndex
location.href=(form.dest.options[myindex].value);
}

// End -->

</script>
<form name="quicklinks">
<div align="center"><center><p><select NAME="dest"
style="BACKGROUND-COLOR: #DEDEDE; COLOR: #003366; FONT-FAMILY: Arial; SIZE=" 1"
onchange="leapto(this.form)" size="1">
<option selected>Quick Search:</option>
<option value="javascript.htm#Favorites">...Please select from list below</option>
<option value="javascriptonmouse.htm">...Accommodation</option>
<option value="javascriptonmouse.htm">...Alternative Lifestyles</option>
<option value="javascriptonmouse.htm">...Business & Finance</option>
<option value="javascriptonmouse.htm">...Club Sports & Rec</option>
<option value="javascriptonmouse.htm">...Computers & Tech</option>
<option value="javascriptonmouse.htm">...Education & Career</option>
<option value="javascriptonmouse.htm">...Entertainment</option>
<option value="javascriptonmouse.htm">...Golf</option>
<option value="javascriptonmouse.htm">...Health & Beauty</option>
<option value="javascriptonmouse.htm">...House & Garden</option>
<option value="javascriptonmouse.htm">...Industry & Develop</option>
<option value="javascriptonmouse.htm">...Internet/Hosting</option>
<option value="javascriptonmouse.htm">...Intros/Personal</option>
<option value="javascriptonmouse.htm">...Motoring</option>
<option value="javascriptonmouse.htm">...Media/Publishing</option>
<option value="javascriptonmouse.htm">...Office Needs</option>
<option value="javascriptonmouse.htm">...Professional Serv</option>
<option value="javascriptonmouse.htm">...Real Estate</option>
<option value="javascriptonmouse.htm">...Restaurants</option>
<option value="javascriptonmouse.htm">...Shop/Fashion/Arts</option>
<option value="javascriptonmouse.htm">...Tourist & Visitor</option>
<option value="javascriptonmouse.htm">...Transport</option>
</select></p>
</center></div>
</form>
Was This Post Helpful? 0
  • +
  • -

#7 Amadeus  Icon User is offline

  • g+ + -o drink whiskey.cpp
  • member icon

Reputation: 248
  • View blog
  • Posts: 13,507
  • Joined: 12-July 02

Re: help with html code

Posted 15 October 2005 - 07:50 AM

<option value="http://www.bigjohnsworld.com/">...Accommodation</option>


Was This Post Helpful? 0
  • +
  • -

#8 danlew  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 21
  • Joined: 10-October 05

Re: help with html code

Posted 16 October 2005 - 06:47 AM

Thankyou very much everyone & most of all Armadeaus for that i appreciate it!
Was This Post Helpful? 0
  • +
  • -

#9 danlew  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 21
  • Joined: 10-October 05

Re: help with html code

Posted 16 October 2005 - 08:58 PM

Ive tried it and it still not working, do i need to change any of the other text?

onchange="leapto(this.form)" size="1">
<option selected>Quick Search:</option>
<option value="javascript.htm#Favorites">...Please select from list below</option>
<option value="http://www.bigjohnsworld.com/">...Accommodation</option>
Was This Post Helpful? 0
  • +
  • -

#10 fyrestorm  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 10
  • View blog
  • Posts: 3,113
  • Joined: 04-April 02

Re: help with html code

Posted 16 October 2005 - 09:16 PM

hi danlew,

i just copied all your code into an html file, and it worked for me...

can I ask, where you put the javascript function?

I put it after the head tag and before the body tag...
Was This Post Helpful? 0
  • +
  • -

#11 danlew  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 21
  • Joined: 10-October 05

Re: help with html code

Posted 17 October 2005 - 01:01 AM

ITS WORKING NOW GUYS,
THIS WEBSITE IS AWESOME, EVERYONE IS VERY HELPFUL, THANKYOU ONCE AGAIN GUYS!
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1