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 / lsisnumeric.cfm < prev    next >
Encoding:
Text File  |  2001-06-13  |  1.4 KB  |  52 lines

  1. <!--- This example shows LSIsNumeric --->
  2.  
  3. <HTML>
  4. <HEAD>
  5. <TITLE>LSIsNumeric Example</TITLE>
  6. </HEAD>
  7.  
  8. <BASEFONT FACE="Arial, Helvetica" SIZE=2>
  9. <BODY  bgcolor="#FFFFD5">
  10.  
  11. <H3>LSIsNumeric Example</H3>
  12.  
  13.  
  14. <CFIF IsDefined("form.locale")>
  15. <!--- if locale is defined, set locale to that entry --->
  16. <CFSET NewLocale = SetLocale("#form.locale#")>
  17.  
  18. <P>Is the value "<CFOUTPUT>#form.myValue#</cFOUTPUT>"
  19. a proper numeric value for <CFOUTPUT>#GetLocale()#</CFOUTPUT>?
  20.  
  21. <P>Answer: <CFOUTPUT>#LSIsNumeric(form.myValue)#</CFOUTPUT>
  22. </CFIF>
  23.  
  24. <P>
  25. <FORM ACTION="lsisnumeric.cfm" METHOD="POST">
  26.  
  27. <P>Select a locale for which you would like to check
  28. a numeric value:
  29.  
  30. <!--- check the current locale for server --->
  31. <CFSET serverLocale = GetLocale()>
  32.  
  33. <P><SELECT name="Locale">
  34. <!--- loop through a list of possible locales and
  35. display --->
  36. <CFLOOP LIST="#Server.Coldfusion.SupportedLocales#" INDEX="locale" DELIMITERS=",">
  37.     <CFSET oldlocale = SetLocale("#locale#")>
  38.     <CFOUTPUT><OPTION value="#locale#" <CFIF locale is ServerLocale>SELECTED</CFIF>>#Locale#</CFOUTPUT>
  39. </CFLOOP>
  40. </SELECT>
  41.  
  42. <CFSET TheServerLocale = SetLocale(serverLocale)>
  43. <P>Enter a numeric value
  44. <P><INPUT TYPE="Text" NAME="MyValue" VALUE="<CFOUTPUT>#LSNumberFormat("121234.25")#</CFOUTPUT>">
  45. <P><INPUT TYPE="Submit" NAME="" VALUE="Is it a valid numeric entry?">
  46.  
  47. </FORM>
  48.  
  49. </BODY>
  50.  
  51. </HTML>       
  52.