Solved

"Please select" on Combo

Posted on 2012-04-12
2
183 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

Suggested Solutions

Title # Comments Views Activity
Check if field exists SPUtility 5 48
why is my slideshow so small on this wordpress site? 7 41
Ajax success not firing alert 6 45
Error just appeared 3 23
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…

710 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