home *** CD-ROM | disk | FTP | other *** search
/ Chip 2002 February / CHIPCD_02_2002.iso / Internet / Macromedia ColdFusion Server 5 / coldfusion-50-win-us.exe / data1.cab / Examples / CFDOCS / snippets / isnumericdate.cfm < prev    next >
Encoding:
Text File  |  2001-06-13  |  1.1 KB  |  51 lines

  1. <!--- This example shows the use of IsNumericDate --->
  2.  
  3. <HTML>
  4.  
  5. <HEAD>
  6. <TITLE>
  7. IsNumericDate Example
  8. </TITLE>
  9. </HEAD>
  10.  
  11. <BASEFONT FACE="Arial, Helvetica" SIZE=2>
  12. <BODY  bgcolor="#FFFFD5">
  13.  
  14. <H3>IsNumericDate Example</H3>
  15.  
  16.  
  17. <CFIF IsDefined("form.theTestValue")>
  18. <!--- test if the value is Numeric or a pre-formatted Date value --->
  19.  
  20.     <CFIF IsNumeric(form.theTestValue) or IsDate(form.theTestValue)>
  21. <!--- if this value is a numericDate value, then pass --->
  22.         <CFIF IsNumericDate(form.theTestValue)>
  23.         <H3>The string <CFOUTPUT>#DE(form.theTestValue)#</CFOUTPUT> is a valid numeric date</H3>
  24.         <CFELSE>
  25.         <H3>The string <CFOUTPUT>#DE(form.theTestValue)#</CFOUTPUT> is not a valid numeric date</H3>
  26.     
  27.         </CFIF>
  28.     <CFELSE>
  29.     <H3>The string <CFOUTPUT>#DE(form.theTestValue)#</CFOUTPUT> is not a valid numeric date</H3>
  30.     </CFIF>
  31.  
  32. </CFIF>
  33.  
  34. <FORM ACTION="isnumericdate.cfm" METHOD="POST">
  35. <P>Enter a string, and discover if
  36. it can be evaluated to a date value.
  37.  
  38. <P><INPUT TYPE="Text" NAME="TheTestValue" VALUE="<CFOUTPUT>#Now()#</CFOUTPUT>">
  39.  
  40. <INPUT TYPE="Submit" VALUE="Is it a Date?" NAME="">
  41.  
  42.  
  43. </FORM>
  44.  
  45.  
  46.  
  47. </BODY>
  48.  
  49. </HTML>       
  50.   
  51.