home *** CD-ROM | disk | FTP | other *** search
/ Australian Personal Computer 1999 April / APC443.iso / features / grpware / coldfus / coldfusi.exe / data1.cab / Documentation / snippets / isnumeric.cfm < prev    next >
Encoding:
Text File  |  1998-10-08  |  775 b   |  44 lines

  1. <!--- This example shows the use of IsNumeric --->
  2.  
  3. <HTML>
  4.  
  5. <HEAD>
  6. <TITLE>
  7. IsNumeric Example
  8. </TITLE>
  9. </HEAD>
  10.  
  11. <BODY bgcolor=silver>
  12.  
  13. <H3>IsNumeric Example</H3>
  14.  
  15. <CFIF IsDefined("form.theTestValue")>
  16.  
  17.     <CFIF IsNumeric(form.theTestValue)>
  18.     <H3>The string <CFOUTPUT>#DE(form.theTestValue)#</CFOUTPUT> can be converted to a number</H3>
  19.     <CFELSE>
  20.     <H3>The string <CFOUTPUT>#DE(form.theTestValue)#</CFOUTPUT> cannot be converted to a number</H3>
  21.  
  22.     </CFIF>
  23.  
  24.  
  25. </CFIF>
  26.  
  27. <FORM ACTION="isnumeric.cfm" METHOD="POST">
  28. <P>Enter a string, and discover if
  29. it can be evaluated to a numeric value.
  30.  
  31. <P><INPUT TYPE="Text" NAME="TheTestValue" VALUE="123">
  32.  
  33. <INPUT TYPE="Submit" VALUE="Is it a Number?" NAME="">
  34.  
  35.  
  36. </FORM>
  37.  
  38.  
  39.  
  40. </BODY>
  41.  
  42. </HTML>       
  43.   
  44.