Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Disable select

Posted on 2011-09-15
2
Medium Priority
?
299 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:
Gurvinder Pal Singh earned 2000 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

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

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
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

636 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