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

  1. <!--- This example shows the use of IsDefined --->
  2.  
  3. <HTML>
  4.  
  5. <HEAD>
  6. <TITLE>
  7. IsDefined Example
  8. </TITLE>
  9. </HEAD>
  10.  
  11. <BODY bgcolor=silver>
  12.  
  13. <H3>IsDefined Example</H3>
  14.  
  15. <CFIF IsDefined("form.myString")>
  16. <P>Because the variable form.myString has been defined, we
  17. can now show its contents.  This construction allows us
  18. to place a form and its resulting action template in the same
  19. template, while using IsDefined to control the
  20. flow of template execution.
  21. <P>The value of "form.myString" is <B><I><CFOUTPUT>#form.myString#</CFOUTPUT></I></B>
  22.  
  23. <CFELSE>
  24. <P>During the first time through this template, the variable
  25. "form.myString" has not yet been defined, so we 
  26. are not attempting to evaluate it.
  27. </CFIF>
  28.  
  29.  
  30. <FORM ACTION="isdefined.cfm" METHOD="POST">
  31.  
  32. <INPUT TYPE="Text" NAME="MyString" VALUE="My sample value">
  33.  
  34.  
  35. <INPUT TYPE="Submit" NAME="">
  36.  
  37.  
  38. </FORM>
  39.  
  40.  
  41.  
  42. </BODY>
  43.  
  44. </HTML>       
  45.     
  46.    
  47.