home *** CD-ROM | disk | FTP | other *** search
/ Chip 2002 February / CHIPCD_02_2002.iso / Internet / Macromedia ColdFusion Server 5 / coldfusion-50-win-us.exe / data1.cab / Examples / CFDOCS / snippets / randrange.cfm < prev    next >
Encoding:
Text File  |  2001-06-13  |  884 b   |  36 lines

  1. <!--- This example shows the use of RandRange --->
  2.  
  3. <HTML>
  4.  
  5. <HEAD>
  6. <TITLE>
  7. RandRange Example
  8. </TITLE>
  9. </HEAD>
  10.  
  11. <BASEFONT FACE="Arial, Helvetica" SIZE=2>
  12. <BODY  bgcolor="#FFFFD5">
  13.  
  14. <H3>RandRange Example</H3>
  15.  
  16. <P>RandRange returns an integer between two specified integers.
  17.  
  18. <CFIF IsDefined("form.myInt")>
  19.     <P>RandRange returned:
  20.         <CFOUTPUT>#RandRange(form.myInt, form.myInt2)#</CFOUTPUT>
  21. </CFIF>
  22.  
  23. <CFFORM ACTION="randrange.cfm" METHOD="POST">
  24. <P>Enter the range:
  25. <CFINPUT TYPE="Text" NAME="MyInt" VALUE="1" RANGE="1,100000000" MESSAGE="Please enter a value between 1 and 100,000,000" VALIDATE="integer" REQUIRED="Yes">
  26. <CFINPUT TYPE="Text" NAME="MyInt2" VALUE="500" RANGE="1,100000000" MESSAGE="Please enter a value between 1 and 100,000,000" VALIDATE="integer" REQUIRED="Yes">
  27. <P><INPUT TYPE="Submit" NAME="">
  28.  
  29.  
  30. </CFFORM>
  31.  
  32.  
  33. </BODY>
  34.  
  35. </HTML>       
  36.