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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Options menu basic

Status
Not open for further replies.

eyetry

Programmer
Oct 2, 2002
560
US
I'm not a web designer and I'm trying to layout a sample html page.

I've defined an options list that displays properly. I want the selection to link to a new document without using a submit button. If this is possible, can anyone tell me what I'm doing wrong?

<select name="DocumentList">
<option value="" selected="selected"></option>
<option href="path\doc1.pdf" target="doc1">Document1</option>
<option href="path\doc2.pdf" target="doc2">Document1</option>
</select>
 
First the <option> tags of a select element don't have href attributes.

You need Javascript to have the select box automatically submit, without a submit button.

Try something like this:
Code:
<select name="DocumentList" onChange="window.open(this.value,'mywindow');">
    <option value="" selected="selected"></option>
    <option value="[URL unfurl="true"]http://www.google.com">Document1</option>[/URL]
    <option value="[URL unfurl="true"]http://www.yahoo.com">Document2</option>[/URL]
</select>

----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Any particular reason you're using a <select> rather than just a <ul> ?
Code:
<ul>
    <li><a href="path/doc1.pdf">Document1</a></li>
    <li><a href="path/doc2.pdf">Document2</a></li>
</ul>

Note solidus not backslash in file name!

___________________________________________________________
If you want the best response to a question, please check out FAQ222-2244 first.
'If we're supposed to work in Hex, why have we only got A fingers?'
Drive a Steam Roller
Steam Engine Prints
 
No great reason. Initially I thought about <ul> but I want several lists on one page. Each of the lists could grow to a couple of dozen items. For example...

One list would cotain links to EDI-X12 standards (implementation guides) by version 4010 thru 5010. Another list might contain links to EDI-X12 code sets. Another might contain links to other categories.

My concern was ending up with a page that was fairly cluttered. I suppose I could try frames with an unordered list. I have a weak understanding of HTML and weaker one of java script. I wanted to KISS. This is really a proof of concept.
 
You could use DIV's to make the lists scrollable. so you have a predefined number of options showing, and the rest are hidden until your scroll down.



----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top