Solved

Disable select

Posted on 2011-09-15
2
294 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
[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
2 Comments
 
LVL 40

Accepted Solution

by:
gurvinder372 earned 500 total points
ID: 36544454
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
ID: 36544515
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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Introduction Got endorsements from your clients?  Great!  There is almost nothing better than word-of-mouth advertising.  But how can you do that on the internet?  Sure you can make a page for endorsement quotations and list them all, but who is …
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
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…

756 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