Rick,

> Do you use Ajax to pass data from the form to CF for validation,
> then return the results to the form page?


95+% of the time, No, I personally do not use Ajax as part of my form 
validation. 

When I build an app, I typically create the form, the form submission action 
logic, and the server-side validation at the early stages of the development. 
Once I get that nailed down, then I add the form user interface, client side 
validation, and all other window dressing elements. So as you can see, the 
server side and the client side validation works independently (obviously it is 
redundant, but I am OK with that).  

This is my personal coding style in which it is reflective of how I learned as 
a developer- being CF first, then JS later.

Now as far as Ajax- I still use ajax only as an enhancement to the user 
experience; as in: auto-populating dropdown selects values, sortables and 
draggables etc.  Perhaps, only time will tell when I will be comfortable enough 
to start depending on ajax for form validation more frequently.

Michael



> -----Original Message-----
> From: Rick Faircloth [mailto:[EMAIL PROTECTED]
> Sent: Saturday, April 14, 2007 1:19 PM
> To: CF-Talk
> Subject: RE: Client-side validation or Server-side Validation?
> 
> Hi, Michael...
> 
> Your perspective agrees with everything I've been reading.
> 
> I was working on using jQuery to display error messages
> and using Ajax to send the form data over to a CF page for
> validation, but I couldn't get everything to work correctly.
> 
> I was very close, but I'm new to JS in general and jQuery in particular
> and just figure out why the scheme wouldn't work.
> 
> Do you use Ajax to pass data from the form to CF for validation,
> then return the results to the form page?
> 
> Rick
> 
> -----Original Message-----
> From: Michael E. Carluen [mailto:[EMAIL PROTECTED]
> Sent: Saturday, April 14, 2007 3:00 PM
> To: CF-Talk
> Subject: RE: Client-side validation or Server-side Validation?
> 
> Rick,
> 
> I agree with Dan and Zaphod's comments.  I personally use both client and
> server side validation, at a minimum spec for my apps, even if I require
> that javascript be turned on.
> 
> Think of it this way- jQuery (or any client side library for that matter)
> can not replace the kind of data integrity enforcement you can do with CF.
> jQuery is great for the form UI and other tasks like data entry
> formatting/data masking. CF, however, is where I do the data logic and
> rule
> heavy-lifting. I prefer that it is CF that 'monitors' any data to be
> written
> on the db.  Again, I do this even if I require javascript be on, at
> minimum.
> 
> 
> If anyone has any comments in this approach, I'm all ears.
> 
> Michael
> 
> 
> > -----Original Message-----
> > From: Dan G. Switzer, II [mailto:[EMAIL PROTECTED]
> > Sent: Saturday, April 14, 2007 8:35 AM
> > To: CF-Talk
> > Subject: RE: Client-side validation or Server-side Validation?
> >
> > Rick,
> >
> > >It's probably just my ignorance about the use of JS, but why
> > >can't JS be coded to insure clean code?
> > >
> > >I mean, if I set up validation to only allow digits on the client-side,
> > >how can they insert hack code that will affect my server?
> > >(I really know next to nothing about hacking servers and the code that
> > >is used, so I really am just looking to be educated...)
> >
> > There are many very easy ways to bypass JavaScript validation. The user
> > can
> > disable it in their browser, a JS error could prevent your validation
> from
> > running, a malicious user could just post data to your form page, etc,
> > etc.
> >
> > The bottom line is you use JS to improve the user's experience. You use
> > server-side validation to ensure your business rules are enforced.
> >
> > Client-side validation is used to provide the user a better experience,
> > but
> > if you assume that client-side code will always run, you are leaving
> your
> > code up to be exploited.
> >
> > -Dan
> >
> >
> >
> 
> 
> 
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Macromedia ColdFusion MX7
Upgrade to MX7 & experience time-saving features, more productivity.
http://www.adobe.com/products/coldfusion?sdid=RVJW

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:275215
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to