How do i create a drop-down box

  • futurebuzz
  • Student
  • Student
  • User avatar
  • Posts: 75
  • Loc: Birmingham England

Post 3+ Months Ago

Hello People,

Yep, how do i do that?

I want one so i can control the style in css.

Thanks for any help!
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • Vladdrac
  • Mastermind
  • Mastermind
  • User avatar
  • Posts: 2136
  • Loc: Louisville, Ky

Post 3+ Months Ago

this goes in the head
Code: [ Select ]
   <SCRIPT LANGUAGE="JavaScript">
   <!-- Begin
   function formHandler(form){
   var URL = document.form.site.options[document.form.site.selectedIndex].value;
   window.location.href = URL;
   }
   // End -->
   </SCRIPT>
  1.    <SCRIPT LANGUAGE="JavaScript">
  2.    <!-- Begin
  3.    function formHandler(form){
  4.    var URL = document.form.site.options[document.form.site.selectedIndex].value;
  5.    window.location.href = URL;
  6.    }
  7.    // End -->
  8.    </SCRIPT>


This goes whereever you want in the body
Code: [ Select ]

   <form name="form">
   <select name="site" size=1>
   <option value="">Click to select
   <option value="http://www.whatever.html">Drop Down Option 1 text
   <option value="http://www.whatever2.html">Drop Down Option 2 text
   </select>
   <input type=button value="Go!" onClick="javascript:formHandler(this)">
   </form>
  1.    <form name="form">
  2.    <select name="site" size=1>
  3.    <option value="">Click to select
  4.    <option value="http://www.whatever.html">Drop Down Option 1 text
  5.    <option value="http://www.whatever2.html">Drop Down Option 2 text
  6.    </select>
  7.    <input type=button value="Go!" onClick="javascript:formHandler(this)">
  8.    </form>



and I guess you can change the option value to whatever.css......but I am not sure if that is what you do or not
  • digitalMedia
  • a.k.a. dM
  • Genius
  • User avatar
  • Posts: 5149
  • Loc: SC-USA

Post 3+ Months Ago

The <select> control is an exception. you can do background color, foreground color, width, you can change the height by changing the font-size. You can also change the font-family.

but...
you can't change the border, or the button. :(

I'm sure you could fake it with a little dhtml.
  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13502
  • Loc: Florida

Post 3+ Months Ago

If you want to see a few things you can change about form elements check this out,
http://e.1asphost.com/joebertvision/too ... /index.asp

NOTE: IE Only.
  • futurebuzz
  • Student
  • Student
  • User avatar
  • Posts: 75
  • Loc: Birmingham England

Post 3+ Months Ago

Hey, thanks for the replies folks!

Decided to drop them... :wink:

Good useful info though, cheers!

Post Information

  • Total Posts in this topic: 5 posts
  • Users browsing this forum: No registered users and 76 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.