Solved

Disable select

Posted on 2011-09-15
2
290 Views
Last Modified: 2012-05-12
Hi, I would like to disable <select> </select>, but  still want users to see the whole dropdown list,
just not being able to select anything.
0
Comment
Question by:Rozamunda
2 Comments
 
LVL 40

Accepted Solution

by:
gurvinder372 earned 500 total points
Comment Utility
now check this, you can see all of them, but can't select them
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
	<script>
		function resetBack(thisObj)
		{
			thisObj.selectedIndex = 0;
		}
	</script>
</HEAD>

<BODY>
	<select onchange="resetBack(this)">
		<option value="1">1</option>
		<option value="2">2</option>
		<option value="3">3</option>
		<option value="4">4</option>
		<option value="5">5</option>
		<option value="6">6</option>
	</select>
</BODY>
</HTML>

Open in new window

0
 
LVL 38

Expert Comment

by:Tom Beck
Comment Utility
To include a visual indication that the list is disabled (grayed out) try this:

<select>
    <option value="val1" disabled="disabled" selected="selected">Value 1</option>
    <option value="val2" disabled="disabled">Value 2</option>
    <option value="val3" disabled="disabled">Value 3</option>
    <option value="val4" disabled="disabled">Value 4</option>
    <option value="val5" disabled="disabled">Value 5</option>
</select>
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction If you're like most people, you have occasionally made a typographical error when you're entering information into an online form.  And to your consternation, the browser remembers the error, and offers to autocomplete your future entr…
How to build a simple, quick and effective accordion menu using just 15 lines of jQuery and 2 css classes
The viewer will learn the basics of jQuery, including how to invoke it on a web page. 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.: (CODE)
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…

772 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now