Solved

"Please select" on Combo

Posted on 2012-04-12
2
182 Views
Last Modified: 2012-04-12
Is it possible to have "please select" in combo boxes in HTML?

Ive got some simple code:-
			<select id="Q2">		
				<option value="Management">Management</option>
				<option value="Finance">Finance</option>
				<option value="Administration">Administration</option>
				<option value="Human Resources">Human Resources</option>
				<option value="Marketing">Marketing</option>
				<option value="Communications">Communications</option>
				<option value="Engineer">Engineer</option>			
			</select> 

Open in new window


What I would like to do is have the initial text set to 'Please select', but not have it as an option that the user can selects when it drops down.

Im assuming it will need some Javascript, but thought Id ask the question before playing around to get a script to do it.

Thank you
0
Comment
Question by:tonelm54
[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
 

Accepted Solution

by:
tonelm54 earned 0 total points
ID: 37838586
Found the answer :-)

			<select id="Q2">		
				<option value="" disabled="disabled" selected="selected">Please select a position</option>
				<option value="Management">Management</option>
				<option value="Finance">Finance</option>
				<option value="Administration">Administration</option>
				<option value="Human Resources">Human Resources</option>
				<option value="Marketing">Marketing</option>
				<option value="Communications">Communications</option>
				<option value="Engineer">Engineer</option>			
			</select> 	

Open in new window

0
 
LVL 1

Expert Comment

by:rjccomps
ID: 37838608
<html>
<div>
<select name="menu">
<option value="0" selected>(please select:)</option>
<option value="1">one</option>
<option value="2">two</option>
<option value="3">three</option>
<option value="other">other, please specify:</option>
</select>
<div><input type="submit" value="submit"></div>
</html>

Open in new window

0

Featured Post

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!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Technology Resume 7 68
Making Table Thru ASP Response.write 5 19
A responsive image gallery using flexbox 6 19
Display Flex does not Wrap Items 2 6
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…

749 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