[^0-9]
On Thu, 1 Aug 2002, Kodjo Ackah wrote:
> Hi,
> The snippet below does check to ensure that a user puts in a digit in a
> form.
> The problem is - if I test this code like adding a letter to the digit
> it does not flag the error.
> I will like to ensure that only digits are allowed and if anyone as much
> as adds a digit after or before -
> an error will be raised!
> Any bright ideas?
>
> <cfif NOT ReFind("[0-9]", form.job_amount,"True")>
> <cfset error_message = "You must enter a number in the
> amount field.">
> <cfset error_fields = ListAppend(error_fields,
> "job_amount")>
> <cfset OK = FALSE>
> </cfif>
>
>
______________________________________________________________________
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists