How do i create a drop-down box

  • futurebuzz
  • Student
  • Student
  • User avatar
  • Joined: Apr 13, 2004
  • Posts: 75
  • Loc: Birmingham England
  • Status: Offline

Post May 6th, 2004, 12:24 pm

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
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post May 6th, 2004, 12:24 pm

  • Vladdrac
  • Mastermind
  • Mastermind
  • User avatar
  • Joined: Feb 04, 2004
  • Posts: 2136
  • Loc: Louisville, Ky
  • Status: Offline

Post May 6th, 2004, 3:39 pm

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
  • Joined: Dec 29, 2003
  • Posts: 5169
  • Loc: SC-USA
  • Status: Offline

Post May 6th, 2004, 5:15 pm

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.
- dM
  • joebert
  • Sledgehammer
  • Genius
  • No Avatar
  • Joined: Feb 10, 2004
  • Posts: 13455
  • Loc: Florida
  • Status: Offline

Post May 6th, 2004, 5:50 pm

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.
Strong with this one, the sudo is.
  • futurebuzz
  • Student
  • Student
  • User avatar
  • Joined: Apr 13, 2004
  • Posts: 75
  • Loc: Birmingham England
  • Status: Offline

Post May 10th, 2004, 1:20 pm

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 186 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
 
cron
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.