Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

style a dropdownlist to not show the down arrow icon on the right?

Posted on 2011-09-20
3
Medium Priority
?
363 Views
Last Modified: 2012-06-27
Is there a way through jquery / css to style a dropdownlist so that it appears as a text label?

See my mock-up.

 ddl
0
Comment
Question by:Tom Knowlton
3 Comments
 
LVL 3

Accepted Solution

by:
mykde earned 1000 total points
ID: 36568351
Unfortunately browsers allow limited skinning of select boxes.  

So I recommend using jQuery to change a select box into a text box and a unorded list for the dropdown.  When a user clicks on the text box it will display the list below the textbox, just like a regular select box, but it’s easier to style.

Here is a link to a very detailed example. http://www.devirtuoso.com/2009/08/styling-drop-down-boxes-with-jquery/
0
 
LVL 83

Assisted Solution

by:leakim971
leakim971 earned 1000 total points
ID: 36569092
may help : http://jsfiddle.net/9UFge/

<span>Select a State</span>
<select>
    <option value="">Select a State</option>
    <option value="AL">Alabama</option>
    <option value="CA">California</option>
</select>

Open in new window


    $("span").click(function() {
        $("select").css("display","block");
    })
    $("select").change(function() {
        $("span").html( $("option:selected",this).text() );
        $("select").css("display","none");
    }) 

Open in new window

0
 
LVL 5

Author Closing Comment

by:Tom Knowlton
ID: 36575244
thx
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

I have answered several questions lately that were solved utilizing the power of jQuery's AJAX functions, so I thought I would write an article demonstrating the ease of use. Why should I use jQuery as opposed to regular JavaScript? Now I know…
Introduction Knockoutjs (Knockout) is a JavaScript framework (Model View ViewModel or MVVM framework).   The main ideology behind Knockout is to control from JavaScript how a page looks whilst creating an engaging user experience in the least …
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

810 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