I have a parameter in a query string that should be a 4-digit
year. I want to validate this to make sure it's numeric, and I was
trying to use cfparam. If it's not numeric, I want to catch the
error in a cfcatch tag, but it keeps skipping that tag & just
displaying the error message anyway. Am I using the tag wrong?
Natg504,
There's nothing really wrong with your code. However, for the
try-catch logic to work, you have to put the catch-block at the
end. In fact, if your version is Coldfusion MX7or newer, you can
even specify the range of years. Examples follow.