Help - Search - Members - Calendar
Full Version: Drop-Down Text Boxes (for links) Question
Movable Type Community Forum > Additional Resources > Tips and Tricks
Solomonia
Question about drop-down text boxes, hope someone can answer just a couple of questions!

My blog is here: Solomonia.com

My links list is getting a bit large, so I finally figured out how to make a link list. I know nothing about Java, so this was something that I found out there on the web and it's working for me. Here's the code in my page:

CODE
<form>
<select onChange="window.open(this.options[this.selectedIndex].value)" width="125px" class="boxattributes">
<option>::Good Blogs::</option>
<option>::that don't link back yet::</option>
<option>-----</option>
<option value="http://www.amritas.com/">Amaravati</option>
<option value="http://americanthinker.com/index.php">The American Thinker</option>
<option value="http://www.andrewsullivan.com/">Andrew Sullivan</option>
<option value="http://andrewapostolou.blogspot.com/">Apostablog</option>
[snip long list of links]

</select>
</form>


In my style-sheet, I control the look with this little snippet:

CODE
.boxattributes  {
               
                background-color: #aabadd;
                font-family : Verdana, Geneva, Arial, Helvetica, sans-serif;
               font-size : x-small;
               }



My questions!

1) How do I get the links not just to open in a new window, but in a named window. For instance, I have all my links open with target="solomonia" (oddly enough). How do I get the text box to do that?

2) How can I get the text centered? Can I use the css entry for that?

Thanks anyone for help/advice.
kadyellebee
You might look back to the site where you got the code to confirm, but a quick google found me this, which leads me to believe that your select statement could look like this:
CODE
<select
onchange="window.open(this.options[this.selectedIndex].value,'solomonia')" width="125" class="boxattributes">

but I don't see why that works, so that site might be not giving a full example.

And adding text-align:center; to the .boxattributes class in your stylesheet seems to work for making all the selections centered. smile.gif

Kristine
Solomonia
Ah! Excellent on the naming the new window thing, that works!

But...the text align thing isn't working for me for some reason...hmmm...
kadyellebee
Ahh, I didn't check it in IE6 - looks like Mozilla is centering it just nicely, but IE doesn't change. So that must be one more of the CSS thngs that IE doesn't support. Sorry!

Kristine
Solomonia
Interesting. OK, well, the target window was the main thing. Maybe MS will patch that..harhar...

Thanks again.
kknet
hi, question:

when a person refreshes a page w/ the drop-down box on it, is there a way for the drop-down box to go back to the first link or whatever and not be stuck on the one previously selected? hope i made sense.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.