• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

When to Use What

Client-side and server-side form validation both have pros and cons and are both valid ways to make sure you only accept form information that is appropriate for the underlying database.

Client-side validation utilizes the user’s browser to do the validation, thus reducing the load on server resources. It also results in fewer round trips between the server and the client. The down side of client-side validation is that you usually have to use some other scripting language like JavaScript to create the form validation function. Even if you use <CFFORM>, ColdFusion is just creating the JavaScript for you. The problem with this is that different browser versions might implement JavaScript commands slightly differently, and some users might disable JavaScript support entirely. In either scenario, if the browser comes across some JavaScript that it does not understand, it will just ignore it altogether, in which case none of your validation routines will run and inappropriate data might be sent to your server.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint