Client-Side Validation Via <cfform>

You’ve already seen how ColdFusion can dramatically simplify server-side validation by automatically generating code for you. Well, it can do the same for client-side validation, generating the JavaScript needed to validate form fields. And the best part is that you already know the tags you need to make this work: they are <cfform> and <cfinput>.

Listing 13.5 contains login3.cfm, a slightly modified version of login2.cfm. Make that very slightly modified. Can you even see the change?

Listing 13.5. login3.cfm—Client-Side Validation Rules
<!--- Name: login3.cfm Author: Ben Forta (ben@forta.com) Description: Form field validation demo Created: 07/01/07 ---> <html> <head> <title>Orange Whip Studios - Intranet</title> ...

Get Adobe ColdFusion 8 Web Application Construction Kit, Volume 1: Getting Started now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.