Solved

"Please select" on Combo

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

WordPress Tutorial 1: Installation & Setup

WordPress is a very popular option for running your web site and can be used to get your content online quickly for the world to see. This guide will walk you through installing the WordPress server software and the initial setup process.

Question has a verified solution.

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

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
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 transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
Suggested Courses

628 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