I have an ajax form that gets submitted to an iframe. On the server-side I want to validate an input as a valid integer, and if it is not validated set it to a default value of 0. Initial solution was:
<cfparam name="FORM.integerField" default="0" type="integer">
But, on form submit if string data was entered then the server throws an error. I don't want the error to be thrown, I want to check the datatype and set it to a default if it fails the check and then keep processing the from. I have also tried things like:
<cfqueryparam value="#atest#" cfsqltype="CF_SQL_NUMERIC"> <!-- inside my query -->
<cfif IsDefined(LSParseNumber(FORM.integerField))>
<cfif LSParseNumber(FORM.integerField)>
Any suggestions?