home *** CD-ROM | disk | FTP | other *** search
/ Australian Personal Computer 1999 April / APC443.iso / features / grpware / coldfus / coldfusi.exe / data1.cab / Documentation / snippets / isnumericdate.cfm < prev    next >
Encoding:
Text File  |  1998-10-08  |  1.1 KB  |  50 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. <BODY bgcolor=silver>
  12.  
  13. <H3>IsNumericDate Example</H3>
  14.  
  15.  
  16. <CFIF IsDefined("form.theTestValue")>
  17. <!--- test if the value is Numeric or a pre-formatted Date value --->
  18.  
  19.     <CFIF IsNumeric(form.theTestValue) or IsDate(form.theTestValue)>
  20. <!--- if this value is a numericDate value, then pass --->
  21.         <CFIF IsNumericDate(form.theTestValue)>
  22.         <H3>The string <CFOUTPUT>#DE(form.theTestValue)#</CFOUTPUT> is a valid numeric date</H3>
  23.         <CFELSE>
  24.         <H3>The string <CFOUTPUT>#DE(form.theTestValue)#</CFOUTPUT> is not a valid numeric date</H3>
  25.     
  26.         </CFIF>
  27.     <CFELSE>
  28.     <H3>The string <CFOUTPUT>#DE(form.theTestValue)#</CFOUTPUT> is not a valid numeric date</H3>
  29.     </CFIF>
  30.  
  31. </CFIF>
  32.  
  33. <FORM ACTION="isnumericdate.cfm" METHOD="POST">
  34. <P>Enter a string, and discover if
  35. it can be evaluated to a date value.
  36.  
  37. <P><INPUT TYPE="Text" NAME="TheTestValue" VALUE="<CFOUTPUT>#Now()#</CFOUTPUT>">
  38.  
  39. <INPUT TYPE="Submit" VALUE="Is it a Date?" NAME="">
  40.  
  41.  
  42. </FORM>
  43.  
  44.  
  45.  
  46. </BODY>
  47.  
  48. </HTML>       
  49.   
  50.