Download presentation
Presentation is loading. Please wait.
1
Client-Side Validation with Javascript
by Daniel Yee
2
Client-Side Scripting Language
Javascript European Computer Manufacturers Association (ECMA) ECMA-262 Third edition Updated Last December 1999
3
Javascript Not a full fledged programming language
Cannot connect to databases Limited interactions to system resources Cannot do tasks most web databases require
4
Common Uses of Javascript
Validation of <form> data Simple interaction with <form> data Adding dynamic elements to web page
5
Benefits of using Javascript
Faster response then using server-side validation Reduction in web-server load Reduction in network traffic Can be saved as a file - file.js and reused by typing <script type= text/javascript src=“file.js”>
6
Warning!!!!!!!!!!!!! Never rely on client-side validation as the only method of ensuring requirements and constraints Javascript can be bypassed by the user through design, error, or configuration
7
Validating <form> Data
Simple example for validating a <form> with JavaScript Check for whitespace
8
Batch Error Reporting Validation for multiple fields
Example
9
Interactive Validation
Password <form> validation Example
10
Dynamic Elements Some implementations not associated with web database applications MouseOver Prefilled calculations
11
MouseOver Creating a mouseOver Event Example
12
Prefilled Calculations
Shopping cart updating Example
13
Conclusion Javascript is a client-side scripting language
Can be used for validating forms and enhancing user interactions Benefits include improved speed, reduced load, and added features
14
REMEMBER!!!!! NEVER USE AS THE ONLY METHOD TO ENSURE REQUIREMENTS, SECURITY, AND CONSTRAINTS WHY? BECAUSE IT CAN BE BYPASSED BY THE USER
15
The End
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.