AJAX Form Validation
Validating input data is an essential requirement for quality and secure software applications. In the case of web applications, validation is an even more sensitive area, because your application is widely reachable by many users with varying skill sets and intentions. Validation is not something to play with, because invalid data has the potential to harm the application's functionality, and even corrupt the application's most sensitive area: the database.
"Computer, draw a robot!" said my young cousin to the first computer he had ever seen. (Since I
had instructed it not to listen to strangers, the computer wasn't receptive to this command.) If
you're like me, your first thought would be "how silly" or "how funny"—but this is a mistake. Our
educated and modeled brains have learned how to work with computers to a certain degree. People
are being educated to accommodate computers, to compensate for the lack of ability of computers
to understand humans.
No matter what kind of ninja you are—a cooking ninja, a corporate lawyer ninja, or
an actual ninja ninja—virtuosity lies in first mastering the basic tools of the trade.
Once conquered, it’s then up to the full-fledged ninja to apply that knowledge in
creative and inventive ways.
In recent times, jQuery has proven itself to be a simple but powerful tool for taming
and transforming web pages, bending even the most stubborn and aging browsers
to our will. jQuery is a library with two principal purposes: manipulating elements
on a web page, and helping out with Ajax requests.
The World Wide Web officially celebrated its 20th birthday as I began writing
this book. In one sense, it’s hard to believe that the technology has
been around this long already. At another level, it’s amazing how much has
happened in that short time. When I started teaching and writing about the
Internet (long before the Web was practical), none of us had any idea what it
was going to turn into one day.
If you’re reading this book, I don’t have to tell you that the Web is a big deal.
It’s come a long way, and it’s doing very interesting things. What I want to
This book begins with you working along as Scott Guthrie builds a complete ASP.NET MVC reference application. He begins NerdDinner by using the File-New Project menu command within Visual Studio to create a new ASP.NET MVC Application. You'll then incrementally add functionality and features.
Advanced ASP.NET Program
PRESENTER: MR. DOAN QUANG MINH
Some addition knowledge
Performing Data Access Validating Form Input Control Styles, Themes, Skins MasterPage SiteMap
ASPX Life Cycle
10 phases of ASPX Life Cycle
The "index" action generates the following form:
If an invalid form is submitted, the server returns the page with a modiﬁed form containing error messages. The error messages are DIVs of class "error", and because of the above web2py ajax code, the errors appears with a slide-down effect:
The color of the errors is given in the CSS code in "layout.html".
The web2py ajax code prevents you from typing an invalid value in the input ﬁeld. This is done before and in addition to, not as a substitute for, the server-side validation.