Solved

drop down menus side by side?

Posted on 2004-04-13
9
393 Views
Last Modified: 2008-03-10
how would i get this drop down menu to the right of a drop down menu like it?

<form>
    <select onChange="if(this.options[this.selectedIndex].value) top.location.href=(this.options[this.selectedIndex].value)">  
       <option>Hardware</option>
       <option value="comp.jsp">Computer</option>
      <option value="printer.jsp">Printer</option>
       <option value="scanner.jsp">Scanner</option>
       <option value="other_hardware.jsp">Other</option>
    </select>
</form>
0
Comment
Question by:Raftor
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
  • +2
9 Comments
 

Expert Comment

by:dawnbudge
ID: 10815297
Best way to align dropdowns (in terms of getting it to look the same in different browsers and platforms) is to use a table with 1 row and 2 columns.  Put the form tag around the outside of your table tags.
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 10815324
style="float:right"  

If the selects are in seperate forms add that to the form tag.  If they are in teh same form add it to the select tag.

Cd&
0
 

Author Comment

by:Raftor
ID: 10815691
That 'sytle = "float:right"' worked but the drop down menus are right beside eachother and on the right hand side of the page. i want them separated a little and centred.  
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 4

Expert Comment

by:monolith_888
ID: 10815740
Put them in a <DIV style="width:100%;text-align:center;"> and add padding:10px (or what you like) to the drop down menus to seperate them
0
 
LVL 4

Expert Comment

by:monolith_888
ID: 10815832
Sorry, that won't work - try this... it's not the neatest in the world, but I had to make for that previous answer :-p

<div style="width:100%;text-align:center;">
      <div style="width:200;text-align:left;">
      <form>
            <select onChange="if(this.options[this.selectedIndex].value) top.location.href=(this.options[this.selectedIndex].value)" style="margin-left:10px;float:right;">
               <option>Hardware</option>
               <option value="comp.jsp">Computer</option>
              <option value="printer.jsp">Printer</option>
               <option value="scanner.jsp">Scanner</option>
               <option value="other_hardware.jsp">Other</option>
            </select>
      </form>
      <form>
            <select onChange="if(this.options[this.selectedIndex].value) top.location.href=(this.options[this.selectedIndex].value)" style="padding:10px;float:right;">
               <option>Hardware</option>
               <option value="comp.jsp">Computer</option>
              <option value="printer.jsp">Printer</option>
               <option value="scanner.jsp">Scanner</option>
               <option value="other_hardware.jsp">Other</option>
            </select>
      </form>
      </div>
</div>
0
 

Author Comment

by:Raftor
ID: 10815914
That did the same thing but on the left hand side this time. But it does have a small space between them which i was looking for.
0
 

Accepted Solution

by:
scottarius earned 30 total points
ID: 10821660
much easier to just use a table:

<table border="0" cellpadding="0" cellspacing="5">
      <tr>
            <form>
            <td>
                  <select onChange="if(this.options[this.selectedIndex].value) top.location.href=(this.options[this.selectedIndex].value)">  
                     <option>Hardware</option>
                     <option value="comp.jsp">Computer</option>
                    <option value="printer.jsp">Printer</option>
                     <option value="scanner.jsp">Scanner</option>
                     <option value="other_hardware.jsp">Other</option>
                  </select>
            </td>
            </form>
            <form>
            <td>
                  <select onChange="if(this.options[this.selectedIndex].value) top.location.href=(this.options[this.selectedIndex].value)">  
                     <option>Hardware</option>
                     <option value="comp.jsp">Computer</option>
                    <option value="printer.jsp">Printer</option>
                     <option value="scanner.jsp">Scanner</option>
                     <option value="other_hardware.jsp">Other</option>
                  </select>
            </td>
            </form>
      </tr>
</table>
0
 

Author Comment

by:Raftor
ID: 10824281
That worked scottarius, cheers.  But how would i seperate them by about half an inch?
0
 

Expert Comment

by:scottarius
ID: 10824331
just adjust the cellspacing until you get the desired width, 20 should probably give you what your looking for:

<table border="0" cellpadding="0" cellspacing="20">
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this. Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it i…
Originally, this post was published on Monitis Blog, you can check it here . Websites are getting bigger and more complicated by the day. Video, images and custom fonts are all great for showcasing your product or service. But the price to pay in…
In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question