Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CFSELECT

Status
Not open for further replies.

GUJUm0deL

Programmer
Joined
Jan 16, 2001
Messages
3,676
Location
US
I would like to know how to have an select choice box (which has the months in it), and have the first field called "SELECT A MONTH" and the following labeled "JANUARY", "FEBRUARY", "MARCH", etc...but I can't get that to work...
How can I have the first <option> set to &quot;SELECT A MONTH&quot; and then have months eneterd using a <CFSELECT>?? I have not failed; I merely found 100,000 different ways of not succeding...
 
Code:
<SELECT>
  <OPTION>Select a Month</OPTION>
  <CFOUTPUT QUERY=&quot;myQuery&quot;>
    <OPTION>#month#</OPTION>
  </CFOUTPUT>
</SELECT>
Kevin
slanek@ssd.fsi.com
 
So this will display the option choices like: Select a month, January, Februaury, etc..., but only bring back data if January or February, etc...are selected?? I have not failed; I merely found 100,000 different ways of not succeding...
 
Code:
<SELECT>
  <OPTION DISABLED>Select a Month</OPTION>
  <CFOUTPUT QUERY=&quot;myQuery&quot;>
    <OPTION VALUE=&quot;#month#&quot;>#month#</OPTION>
  </CFOUTPUT>
</SELECT>
That will display exactly what you're talking about but will prevent users from actually choosing the text &quot;Select a Month&quot; and submitting it.

Of course this only works if you have months in a database, otherwise you'll have to input the months yourself.
Code:
<SELECT>
  <OPTION DISABLED>Select a Month</OPTION>
  <OPTION VALUE=&quot;jan&quot;>January</OPTION>
  <OPTION VALUE=&quot;feb&quot;>February</OPTION>
  .
  .
  .
  <OPTION VALUE=&quot;dec&quot;>December</OPTION>
  </CFOUTPUT>
</SELECT>
Kevin
slanek@ssd.fsi.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top