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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

drop down menu 1

Status
Not open for further replies.

dip

Programmer
Aug 15, 2000
20
SG
How do i validate date and time which is a drop down menu?

The date has day(1 to 31), the month (January to December)which is a drop down menu and the year field which takes the system year(it is not a drop down menu)

The time consists of hour, minute and am, pm which all of them is a drop down menu.

I have tried using coldfusion validation but it doesn't work for the date. This is the code which i used to display the date and the validation. May i know how does coldfusion does validation for drop down menus like date and time.

<tr>
<td nowrap>
<div align=&quot;right&quot;><font face=&quot;Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;>
<b>Date : </b></font></div>
</td>
<td> <font size=&quot;2&quot;>
<Select name=&quot;b_date_day&quot; size=1>
<option value=&quot;1&quot;<cfif b_date_day IS &quot;1&quot;>selected</cfif>>01
<option value=&quot;2&quot;<cfif b_date_day IS &quot;2&quot;>selected</cfif>>02
<option value=&quot;3&quot;<cfif b_date_day IS &quot;3&quot;>selected</cfif>>03
<option value=&quot;4&quot;<cfif b_date_day IS &quot;4&quot;>selected</cfif>>04
<option value=&quot;5&quot;<cfif b_date_day IS &quot;5&quot;>selected</cfif>>05
<option value=&quot;6&quot;<cfif b_date_day IS &quot;6&quot;>selected</cfif>>06
<option value=&quot;7&quot;<cfif b_date_day IS &quot;7&quot;>selected</cfif>>07
<option value=&quot;8&quot;<cfif b_date_day IS &quot;8&quot;>selected</cfif>>08
<option value=&quot;9&quot;<cfif b_date_day IS &quot;9&quot;>selected</cfif>>09
<option value=&quot;10&quot;<cfif b_date_day IS &quot;10&quot;>selected</cfif>>10
<option value=&quot;11&quot;<cfif b_date_day IS &quot;11&quot;>selected</cfif>>11
<option value=&quot;12&quot;<cfif b_date_day IS &quot;12&quot;>selected</cfif>>12
<option value=&quot;13&quot;<cfif b_date_day IS &quot;13&quot;>selected</cfif>>13
<option value=&quot;14&quot;<cfif b_date_day IS &quot;14&quot;>selected</cfif>>14
<option value=&quot;15&quot;<cfif b_date_day IS &quot;15&quot;>selected</cfif>>15
<option value=&quot;16&quot;<cfif b_date_day IS &quot;16&quot;>selected</cfif>>16
<option value=&quot;17&quot;<cfif b_date_day IS &quot;17&quot;>selected</cfif>>17
<option value=&quot;18&quot;<cfif b_date_day IS &quot;18&quot;>selected</cfif>>18
<option value=&quot;19&quot;<cfif b_date_day IS &quot;19&quot;>selected</cfif>>19
<option value=&quot;20&quot;<cfif b_date_day IS &quot;20&quot;>selected</cfif>>20
<option value=&quot;21&quot;<cfif b_date_day IS &quot;21&quot;>selected</cfif>>21
<option value=&quot;22&quot;<cfif b_date_day IS &quot;22&quot;>selected</cfif>>22
<option value=&quot;23&quot;<cfif b_date_day IS &quot;23&quot;>selected</cfif>>23
<option value=&quot;24&quot;<cfif b_date_day IS &quot;24&quot;>selected</cfif>>24
<option value=&quot;25&quot;<cfif b_date_day IS &quot;25&quot;>selected</cfif>>25
<option value=&quot;26&quot;<cfif b_date_day IS &quot;26&quot;>selected</cfif>>26
<option value=&quot;27&quot;<cfif b_date_day IS &quot;27&quot;>selected</cfif>>27
<option value=&quot;28&quot;<cfif b_date_day IS &quot;28&quot;>selected</cfif>>28
<option value=&quot;29&quot;<cfif b_date_day IS &quot;29&quot;>selected</cfif>>29
<option value=&quot;30&quot;<cfif b_date_day IS &quot;30&quot;>selected</cfif>>30
<option value=&quot;31&quot;<cfif b_date_day IS &quot;31&quot;>selected</cfif>>31
</select>
<Select name=&quot;b_date_month&quot; size=1>
<option value=&quot;1&quot;<cfif b_date_month IS &quot;1&quot;>selected</cfif>>January
<option value=&quot;2&quot;<cfif b_date_month IS &quot;2&quot;>selected</cfif>>February
<option value=&quot;3&quot;<cfif b_date_month IS &quot;3&quot;>selected</cfif>>March
<option value=&quot;4&quot;<cfif b_date_month IS &quot;4&quot;>selected</cfif>>April
<option value=&quot;5&quot;<cfif b_date_month IS &quot;5&quot;>selected</cfif>>May
<option value=&quot;6&quot;<cfif b_date_month IS &quot;6&quot;>selected</cfif>>June
<option value=&quot;7&quot;<cfif b_date_month IS &quot;7&quot;>selected</cfif>>July
<option value=&quot;8&quot;<cfif b_date_month IS &quot;8&quot;>selected</cfif>>August
<option value=&quot;9&quot;<cfif b_date_month IS &quot;9&quot;>selected</cfif>>September
<option value=&quot;10&quot;<cfif b_date_month IS &quot;10&quot;>selected</cfif>>October
<option value=&quot;11&quot;<cfif b_date_month IS &quot;11&quot;>selected</cfif>>November
<option value=&quot;12&quot;<cfif b_date_month IS &quot;12&quot;>selected</cfif>>December
</select>
<cfoutput>
<cfinput type=&quot;Text&quot; Name=&quot;b_date_year&quot; size=&quot;4&quot; Maxlength=&quot;4&quot; value=&quot;#b_date_year#&quot; required=&quot;Yes&quot;
message=&quot;Date field should not be left blank!&quot;></cfoutput>
</font></td>
</tr>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top