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

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