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

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