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

  1. <!--- This example shows ParameterExists --->
  2.  
  3. <HTML>
  4.  
  5. <HEAD>
  6. <TITLE>
  7. ParameterExists Example
  8. </TITLE>
  9. </HEAD>
  10.  
  11. <BODY bgcolor=silver>
  12.  
  13. <H3>ParameterExists Example</H3>
  14.  
  15. <CFIF ParameterExists(form.myString)>
  16. <P>Using ParameterExists, we have shown that the form
  17. field "myString" now exists.  However, this function is
  18. provided for backward compatibility with Cold Fusion 2.0 and
  19. the function IsDefined should be used instead, as below.
  20.  
  21.  
  22. </CFIF>
  23.  
  24. <CFIF IsDefined("form.myString")>
  25. <P>Because the variable form.myString has been defined, we
  26. can now show its contents.  This construction allows us
  27. to place a form and its resulting action template in the same
  28. template, while using IsDefined to control the
  29. flow of template execution.
  30. <P>The value of "form.myString" is <B><I><CFOUTPUT>#form.myString#</CFOUTPUT></I></B>
  31.  
  32. <CFELSE>
  33. <P>During the first time through this template, the variable
  34. "form.myString" has not yet been defined, so we 
  35. are not attempting to evaluate it.
  36. </CFIF>
  37.  
  38.  
  39. <FORM ACTION="parameterexists.cfm" METHOD="POST">
  40.  
  41. <INPUT TYPE="Text" NAME="MyString" VALUE="My sample value">
  42.  
  43.  
  44. <INPUT TYPE="Submit" NAME="">
  45.  
  46.  
  47. </FORM>
  48.  
  49.  
  50.  
  51. </BODY>
  52.  
  53. </HTML>       
  54.     
  55.    
  56.