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

What's Next

In this chapter, you learned how <cfform> and its related tags can add JavaScript to your HTML forms so that user input can be checked over prior to form submission. You saw how to make text, password, check box, and radio button fields required by using the <cfinput> tag. You also saw how to validate date, numeric, telephone, Social Security number, and credit card number fields to make sure that data entered into those fields is formatted correctly. Finally, you saw a comparison of the JavaScript that ColdFusion writes to JavaScript written by hand. ColdFusion's JavaScript may seem to be a bit more cumbersome, but it has to be that way to be applicable in a broad range of data validation situations.

One of the principal reasons for using JavaScript in your ColdFusion applications is to relieve your Web server of some of its processing burden. For all your Web server can do, it unfortunately cannot remember anything it does to generate a page. When HTML code is sent on its way to a requesting browser, a Web server does a “brain dump” and promptly forgets all the work it did to generate the page. ColdFusion behaves in much the same way—form variables, URL variables, query variables, and variables you create with <cfset> are eliminated from memory after ColdFusion processes a script. This lack of memory is referred to as a stateless environment, and it presents a challenge to all Web developers. Fortunately, mechanisms such as HTML hidden form fields, HTTP cookies, and ColdFusion session variables can help you build memory into the stateless Web environment. You'll learn how to use these technologies in the next chapter.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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