Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.
-
mate of the state #1
Validating forms using CFCs
Currently, my method for server-side form validation goes like so:
1) Each form is created with a hidden field named "toValidate" which passes a
value determining which set of rules to check.
2) In Application.cfm, I include a file called something like "validation.cfm"
which contains a switch the checks the value of #form.toValidate#. If it finds
a match, it goes over a series of conditionals verifying input length, format,
etc. When it finds errors, it stores them in a struct.
3) Back on the form page, which has been posted to itself, there is a check
for the length of the errors struct. If gt 0, we show the form and error
messages, else we process and go about our business
My question is how I can take this process and abstract it to CFCs. I think I
understand well enough how to use a CFC as the forms ACTION, and then how to do
the validation checks in a method called something like validate() for
instance, but from there I'm not so sure... for instance, if there were errors,
how do I pass those back to the form page?
***
Are there other methods worth looking into? I've done a bit of searching for
resources on form validation with CFCs, and I can't find much.
mate of the state Guest
-
validating datagridtextboxcolumn textbox, validating event fire twice, why?
Anyone has the same experience? I am trying to validate one of the textboxes inside a datagrid, but everytime when i click my mouse on another... -
CFCs & Dot Notation
Here is what I have. A CFC with filename amCurPatientCount.cfc which is located in the "components" folder under the webroot. I have been able to... -
CFCs and MX7
I have a site with a photo album that utilizes CFCs and it worked great until my ISP switched to MX7. When they asked me if I thought I would have... -
Is cfinclude'ing from CFCs bad?
Is it bad to CFINCLUDE a cfm file from a ColdFusion Component? We have run into some strange problems, which we believe are related to a shortage... -
Need some help with validating forms
I have prepared a form. Everything works fine, however I want to validate the form on the following: 1. Required fields are filled in completely...



Reply With Quote

