Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Beginners question about drop down boxes

Status
Not open for further replies.

dobi

Technical User
Feb 18, 2003
3
US
I'm a newly appointed webmaster with no experience in it and trying to get the basics so I have two questions:
1. Anyone have recommendations for books or learning tools (so I don't have to keep asking these beginner questions)

2. I am trying to create a drop down box to act as a TOC for something further down in the same file. I can create the box and options and I think that I have everything else right but when I try and follow the link, I get a debug scripting error that says Error: Permission Denied. Here is what I have in html:

<form>
<select name=demo1 size=&quot;1&quot;
onchange=&quot;location.href=(form.demo1.options[form.demo1.selectedIndex].value)&quot;
align=&quot;center&quot;>

style=&quot;margin-top: 0; margin-bottom: 0&quot;
align=&quot;center&quot;
style=&quot;color:navy&quot;
style=&quot;border:eek:utset&quot;
style=&quot;font-size: 10&quot;
style=&quot;background:#ffffff&quot;>
<option value=<a href=&quot;#Chapter 2&quot;>Chapter 2</option>
<option value=<a href=&quot;#Chapter 3&quot;>Chapter 3</option>
<select>
<form>


I am using this as experimentation and do not have it on our web server. It is on a desktop that has front page 2000 installed. It is a protected page on our web server so I am curious to see if that transferred somehow but than I am not sure.

Thanks in advance,
Steve
 
dobi, try this code...

<html>
<head>
</head>

<body>
<form name=&quot;form&quot;>
<select name=demo1 size=&quot;1&quot; onchange=&quot;location.href=(form.demo1.options[form.demo1.selectedIndex].value)&quot; align=&quot;center&quot;>
<option value=&quot;&quot;>Choose One</option>
<option value=&quot;#Chapter 2&quot;>Chapter 2</option>
<option value=&quot;#Chapter 3&quot;>Chapter 3</option>
</select>
</form>
</body>
</html>


All start tage must have a close tag...like <form></form> and <option></option>, look at your code and look at mine, see the difference??
For some beginning HTML help go to:

Forget the Nobel Peace prize, I just want to take over the world!! [hammer]
 
GUJUmOdel,

so the </select> close the tag for the <select name....> and the </form> close the tag for <form name=&quot;form> right? Also in my line where I put <option value=<a href=&quot;#chapter 2&quot;>Chapter 2 </option> and you have omitted the a href, is that if it is a link to another webpage? Just curious.

Thanks for the help. It works.

Dobi
 
dobi, that's correct...
In HTML ever opening tag needs a closing tag, <html></html>, <a>, </a>, <form></form>, etc...
In a <select> you can just point the URL in the value field, like what I did, just replace what I put with any other URL and it'll work just fine...
For more help, look into
Forget the Nobel Peace prize, I just want to take over the world!! [hammer]
 
> you have omitted the a href, is that if it is a link to another webpage? Just curious.

Your <select> tag contains this bit of script:

onchange=&quot;location.href=(form.demo1.options[form.demo1.selectedIndex].value)&quot;

What this means (more or less) is &quot;Whenever the selected value of this list changes, change the current screen's address to the value of the selected option&quot;. So the values you give each <option> should be the target URLs, not full-blown hyperlink tags.


> Anyone have recommendations for books or learning tools?

It's difficult to make solid recommendations as much depends on your background and the approach that you find most useful. Personally I favour the &quot;animal&quot; books by O'Reilly ( ), they're unbeatable (IMO) for people with a technical background, but perhaps a little short on hand-holding for the less propeller-headed. Go to a big bookshop and take some time leafing through the available titles till you find one that &quot;speaks your language&quot; - then go home and buy it on Amazon...

As for sites, the same strictures apply - though at least you don't have to spend any money to try them! There are too many to list (the partners of this site are a good place to start), I find new ones all the time - and still learn new things from them. A recent discovery is which has a nice selection of articles at all levels. Just get surfing!

-- Chris Hunt
Extra Connections Ltd
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top