!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
Lecture 18: Client-side Form Validation/Processing
Lecture 18
Client-side Form Validation and Processing
Ketan Mayer-Patel
University of North Carolina, Chapel Hill
Client-side Form Validation
- Check inputs before sending them to the server.
- event.stop()
- Convenience function on event data object
- Same as doing both:
- event.stopPropagation();
- event.preventDefault();
- Example 1
Client-side Form Processing
- Form information only being used on client-side
- More common these days with AJAX based interfaces
- Two ways:
- Process form 'submit' event.
- Process 'click' event on submit button.
- Either case:
- Need to call event.stop() to prevent form from going to server-side.
- Example 2
Assignment 5
- Due. Nov. 22
- One more assignment after that.
Rest of Year
- 11/15, 11/17, 11/22
- Web Services, AJAX, and RESTful Interfaces
- 11/24
- 11/29
- 12/1
- 12/6
- 12/8