Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

drop down menus side by side?

Posted on 2004-04-13
9
Medium Priority
?
395 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 120 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

670 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