Methods and Systems of Automated Client-Server Data Validation
Methods and systems of automated data validation by client computer and by server computer based upon a form containing at least one form entry with at least one associated validation rule are presented.
The present application is a continuation of U.S. application Ser. No. 12/110,192 filed on Apr. 25, 2008, which is a continuation of U.S. application Ser. No. 10/203,016 filed on Aug. 2, 2002 which is now issued as U.S. Pat. No. 7,366,977. Each of the aforementioned patent(s) and application(s) are hereby incorporated by reference in their entirety.
TECHNICAL FIELDThis invention relates to checking the validity of data entry in web-based systems.
BACKGROUND ARTIn web-based systems involving data entry, there is a problem in checking the validity of the data. The prior art provides three choices, each having disadvantageous consequences:
-
- 1. Check the data only at the client. This lets you be responsive to the user (you can display helpful messages in a timely way), but leaves your system open to bad data from entities that bypass your client and speak directly to your server.
- 2. Check the data only at the server. This ensures that the server does not accept bad data, no matter what client is used to send it, but is harder to use because it may take a while to display messages to the user when data is incorrectly entered.
- 3. Check the data at the client and at the server. This is responsive to the user and is safe from bad data, but requires a lot of engineering work because the data validation code has to be maintained on two platforms.
The present invention provides a way to validate data entry at both the client and the server with minimal engineering effort.
The system allows engineers to specify data validation rules for a form on a server. The system provides a version of the rules with the form to the client computer. The system also executes the rules on the server for further validation. The system may translate the rules into JavaScript data structures, passed as the version to the client for client-side validation. Because engineers only specify the rules for the form once, there is no possibility of the rules becoming out of sync between the form on the client and on the server.
A set of validation rules can be specified for each form (web page where data entry is allowed). Each rule is associated with a form element (e.g. the users email address or a phone number) and defines what is allowed and what is required for that form element.
Each rule can be created from a set of reusable, configurable constraints.
There is a set of pre-written constraints. New constraints can be added. Currently there are number constraints and string constraints.
Number constraints produce rules that force a field to be numeric and may also specify minimum and/or maximum values that the user must meet. String constraints produce rules that may have minimum or maximum lengths, may allow only certain characters, may require certain characters and may or may not allow white space (e.g. spaces, tabs).
Each supported constraint consists of server-side Java code and client-side JavaScript code.
When the server sends the form down to the browser it includes some JavaScript data structures, which are automatically generated from the set of rules that were defined for the form. When the user attempts to submit the form, some JavaScript code first iterates through each rule that was included in the automatically generated data structures. Each rule is checked against the appropriate entry field. If there is a violation of the rule, the JavaScript code immediately displays a message without involving the server. The generated data structure includes message text for each rule that can be displayed if the user violates a rule.
When the server receives a posted form, it iterates through each of the rules defined for that set. If there is a violation of the rule, the server responds to the client with an error message.
These and other advantages of the present invention will become apparent upon reading the following detailed descriptions and studying the various figures of the drawings.
The present invention provides a way to validate data entry at both the client and the server with minimal engineering effort. The system allows engineers to specify data validation rules for each form or web page where data entry is allowed.
Server computer 4 is accessibly coupled 6 to memory 8 containing one form entry 12 associated with at least server rule 14 and at least one client rule 16 based upon form 10.
Form 10 may further comprise a second form entry 22 associated with at least one server rule 24 and at least one client rule 26.
There may be a second form 30 comprising at least one form entry 32 associated with at least server rule 34 and at least one client rule 36.
Memory 8 may further include program system 100 operating server computer 4 communicating 40-42 with client computer 50 to embody validation of data entry 52 by client 54 both by the client computer 50 using local client rules 66 and server computer 4 using server rules 44.
Memory 8 may include, but is not limited to, volatile memory and non-volatile memory. Memory 8 may include, but is not limited to, at least two memory components. The memory components may include volatile memory components and non-volatile memory components. At least one memory component may be organized as a file management system. The file management system, memory component may include, but is not limited to, at least one of the following: a semiconductor memory device, a disk drive and a disk array.
Server computer 4 communicatively couples 40-42 to client computer 50. Where arrows 40 and 42 meet may include, but is not limited to, a gateway, which may or may not possess redundant portals. Where arrows 40 and 42 meet may include, but is not limited to, a firewall. Where arrows 40 and 42 meet may include, but is not limited to, a web site.
As used herein, a computer will include, but is not limited to, instruction processors operating on one or more data streams concurrently and may execute one or more concurrent instruction streams. A computer will include, but is not limited to, inferential engines controlled by an inferential state. The inferential state may be changed by alterations in the active inferential rules, facts contained in a fact database and facts derived from interactions such as client data entry.
As used herein, the operational steps of the methods of this invention may be performed in finite state machines. The operational steps of the methods of this invention may be performed as program steps residing in memory accessibly coupled to a collection of one or more computers. Program steps may be interpreted or natively executed by the computers. Program steps may represent instructions in machine portable interpreted languages including, but not limited to various forms of one or more of the following: HTTP, XML, JAVA, Prolog, LISP, Scheme, C, C++, Smalltalk, FORTRAN and COBOL.
The program steps may implement machine language operations of a computer, interpreted instructions or inferential rules or facts carried out by at least one computer in the systems described herein.
Arrow 110 directs the flow of execution from starting operation 100 to operation 112. Operation 112 performs the client computer receiving the form entry and at least one associated validation rule contained in the form to create the client form entry with at least one associated local client rule. Arrow 114 directs execution from operation 112 to operation 116. Operation 116 terminates the operations of this flowchart.
Arrow 120 directs the flow of execution from starting operation 100 to operation 122. Operation 122 performs the client computer processing the client form entry using the client data entry and satisfying all of the associated local client rules to create a client form data entry received by the server computer. Arrow 124 directs execution from operation 122 to operation 116. Operation 116 terminates the operations of this flowchart.
Arrow 130 directs the flow of execution from starting operation 100 to operation 132. Operation 132 performs the server computer validating the client form data entry received from the client computer based upon all of the associated validation rules of the form entry contained in the form. Arrow 134 directs execution from operation 132 to operation 116. Operation 116 terminates the operations of this flowchart.
Arrow 150 directs the flow of execution from starting operation 132 to operation 152. Operation 152 performs the server computer receiving the client form data entry from the client computer. Arrow 154 directs execution from operation 152 to operation 156. Operation 156 performs the server computer validating the client form data entry based upon all of the associated validation rules of the form entry contained in the form. Arrow 158 directs execution from operation 156 to operation 160. Operation 160 terminates the operations of this flowchart.
Note that as used herein, the flowcharts of this document depict an illustrative manner by which to understand the operations of the various methods of certain embodiments of the invention.
In certain embodiments of the invention, concurrent object paradigms, often supporting real-time event-driven operating system may be supported. Such embodiments may further support message passing as a way to trigger events. As such, an arrow and the flow of execution represented by that arrow may serve to depict disparate actions in a variety of distinct objects, which taken in their entirety form an embodiment of the invention.
Note that operation 152 may be performed a different number of times than operation 156, in such embodiments of the invention utilizing real-time event-driven operating environments for concurrent objects supporting messaging, such as JAVA and C++.
In certain embodiments of the invention supporting inferential engines, these flowcharts portray the inferential action of the components of the inference system embodied.
Arrow 170 directs the flow of execution from starting operation 122 to operation 172. Operation 172 performs the client computer processing the client form entry based upon input from the client to create an initial client form data entry. Arrow 174 directs execution from operation 172 to operation 176. Operation 176 terminates the operations of this flowchart.
Arrow 180 directs the flow of execution from starting operation 122 to operation 182. Operation 182 performs the client computer sending the initial client form data entry to the server computer to create the client form data entry whenever the initial client form data entry satisfies all of the associated local client rules. Arrow 184 directs execution from operation 182 to operation 176. Operation 176 terminates the operations of this flowchart.
Arrow 210 directs the flow of execution from starting operation 182 to operation 212. Operation 212 determines when the initial client form data entry satisfies all of the associated local client rules. Arrow 214 directs execution from operation 212 to operation 216 when the determination is ‘Yes’. Arrow 228 directs execution to 220 when the determination is ‘No’.
Operation 216 performs the client computer sending the initial client form data entry to the server computer to create the client form data entry. Arrow 218 directs execution from operation 216 to operation 220. Operation 220 terminates the operations of this flowchart.
Arrow 230 directs the flow of execution from starting operation 216 to operation 232. Operation 232 performs the client encrypting the initial client form data entry to create an encrypted data entry. Arrow 234 directs execution from operation 232 to operation 236. Operation 236 performs the client sending the encrypted data entry to the server computer. Arrow 238 directs execution from operation 236 to operation 240. Operation 240 terminates the operations of this flowchart.
Arrow 250 directs the flow of execution from starting operation 152 to operation 252. Operation 252 performs the server receiving the encrypted data entry. Arrow 254 directs execution from operation 252 to operation 256. Operation 256 performs the server computer decrypting the encrypted data entry to create the client form data entry. Arrow 258 directs execution from operation 256 to operation 260. Operation 260 terminates the operations of this flowchart.
Memory 8 may contain form 10.
Memory 58 may include a web browser 60. Web browser 60 may further perform client operations supporting the program system 100. Note that in certain embodiments of the invention, the browser 60 may download a version of those client operations and form as a web page.
Memory 58 may include client form 10.
Note that rule 16 is associated with form entry 12 and form entry 22. An example of a rule which is associated with more than one form entry would be a rule which validates that birth date and age must be close to each other. A birth date entry indicating an age of 16 and an age entry of 21 should fail such a validation rule.
Server computer 74 may provide client computer 50 with client form entry 62 and associated local client rules 66.
Server computer 84 may provide server rules 14 to server computer 4.
Server computer 84 may further provide form 10 to server computer 74.
Server computer 84 may provide a version of form 10 to server computer 74.
Server computer 84 may generate a version of form 10.
Server computer 74 may generate a version of form 10 to send to client computer 50.
Note that in certain embodiments, form 10 may include form entries 12 with pre-computed versions of the server rules 14 and client rules 16.
Arrow 270 directs the flow of execution from starting operation 100 to operation 272. Operation 272 performs a second server computer providing the client computer a version of the form entry and at least one associated validation rule. Arrow 274 directs execution from operation 272 to operation 276. Operation 276 terminates the operations of this flowchart.
Arrow 290 directs the flow of execution from starting operation 112 to operation 292. Operation 292 performs the client computer receiving the one form entry and all of the associated validation rules from the second server computer to create the client form entry with at least one associated local to client rule. Arrow 294 directs execution from operation 292 to operation 296. Operation 296 terminates the operations of this flowchart.
Arrow 310 directs the flow of execution from starting operation 272 to operation 312. Operation 312 performs the second server computer generating a version of all the associated validation rules based upon the one form entry and all of the associated validation rules. Arrow 314 directs execution from operation 312 to operation 316. Operation 316 performs the second server computer sending the version to the client computer to create all the associated local client rules. Arrow 318 directs execution from operation 316 to operation 320. Operation 320 terminates the operations of this flowchart.
Arrow 330 directs the flow of execution from starting operation 112 to operation 332. Operation 332 performs the client computer receiving the one form entry to create the client form entry. Arrow 334 directs execution from operation 332 to operation 336. Operation 336 performs the client computer receiving the version of all the associated validation rules to create all the local client rules associated with the client form entry. Arrow 338 directs execution from operation 336 to operation 340. Operation 340 terminates the operations of this flowchart.
Note that in certain embodiments of the invention, a version of the form entry may be received as well.
Arrow 350 directs the flow of execution from starting operation 272 to operation 352. Operation 352 performs the second server computer providing the client computer the form entry and all the associated validation rules to create the client form entry with all the associated local client rules, for each of the form entries with the associated validation rules contained in the form. Arrow 354 directs execution from operation 352 to operation 356. Operation 356 terminates the operations of this flowchart.
Arrow 370 directs the flow of execution from starting operation 122 to operation 372. Operation 372 performs the client computer receiving a submission request from the client to create a form submission request. Arrow 374 directs execution from operation 372 to operation 376. Operation 376 terminates the operations of this flowchart.
Arrow 380 directs the flow of execution from starting operation 122 to operation 382. Operation 382 performs the client computer validating the client form entry based upon all of the associated local client rules to create a validated client form data entry, whenever the client computer receives the form submission request, for each form entry with at least one associated validation rule contained in the form. Arrow 384 directs execution from operation 382 to operation 376. Operation 376 terminates the operations of this flowchart.
Arrow 390 directs the flow of execution from starting operation 122 to operation 392. Operation 392 performs the client computer sending all of the validated client form data entries to the server computer to create all of the client form data entries for the form whenever the initial client form data entries satisfy all of the associated local client rules, for all of the at least one form entry with at least one associated validation rule contained in the form. Arrow 394 directs execution from operation 392 to operation 376. Operation 376 terminates the operations of this flowchart.
Arrow 410 directs the flow of execution from starting operation 100 to operation 412. Operation 412 performs maintaining a form collection including at least one form comprised of at least one form entry with at least one associated validation rule. Arrow 414 directs execution from operation 412 to operation 416. Operation 416 terminates the operations of this flowchart.
Arrow 430 directs the flow of execution from starting operation 412 to operation 432. Operation 432 performs receiving a first form and specifying an associated validation rule set for the first form from a development computer. Arrow 434 directs execution from operation 432 to operation 436. Operation 436 performs adding the first form and the associated validation rule set into the form collection. Arrow 438 directs execution from operation 436 to operation 440. Operation 440 terminates the operations of this flowchart.
Certain embodiments of the invention may include preparing a form containing at least one form entry with at least one associated validation, and sending that form to be added to a form collection.
Such operations may be performed as program steps residing in memory accessibly coupled to a development computer. The development computer may further be a server development computer or a client development computer. The server development computer may further belong to the server system containing the server computer. The server development computer may further be any of the following: the server computer 4 the second server computer 74 or the third server computer 84.
Sending the form to be added to the maintained form collection may further include sending the form as a message to a method of an object of a class maintaining a form collection available to server computer 4. The form collection may further be available to second server computer 74.
Arrow 450 directs the flow of execution from starting operation 100 to operation 452. Operation 452 performs developing the first form and specifying an associated validation rule set for the first form. Arrow 454 directs execution from operation 452 to operation 456. Operation 456 terminates the operations of this flowchart.
Arrow 460 directs the flow of execution from starting operation 100 to operation 462. Operation 462 performs sending the first form and the associated validation rule set for addition into the form collection. Arrow 464 directs execution from operation 462 to operation 456. Operation 456 terminates the operations of this flowchart.
Note that the associated validation rule set may be comprised of at least one associated validation rule.
Each of the associated validation rules may be associated with at least one form entry of the form collection.
Each rule may be created from a set of reusable, configurable constraints.
There may be a set of pre-written constraints. Currently there are number constraints and string constraints.
New constraints may be added.
Number constraints produce rules that force a field to be numeric and may also specify minimum and/or maximum values that the user must meet. String constraints produce rules that may have minimum or maximum lengths, may allow only certain characters, may require certain characters and may or may not allow white space (e.g. spaces, tabs).
Each supported constraint consists of server-side Java code and client-side JavaScript code.
The system may translate the rules of the form into JavaScript data structures, which are passed to the client for client-side validation of the form entries and the system also executes the rules on the server for further validation of the form entries. Because engineers only specify the rules once for the form, there is no possibility of the rules becoming out of sync between the form on the client and on the server.
Arrow 470 directs the flow of execution from starting operation 452 to operation 472. Operation 472 performs maintaining a form entry collection containing at least one form entry. Arrow 474 directs execution from operation 472 to operation 476. Operation 476 terminates the operations of this flowchart.
Arrow 480 directs the flow of execution from starting operation 452 to operation 482. Operation 482 performs specifying the associated validation rule set based upon the form entry collection. Arrow 484 directs execution from operation 482 to operation 476. Operation 476 terminates the operations of this flowchart.
Arrow 490 directs the flow of execution from starting operation 112 to operation 492. Operation 492 performs the client computer receiving the step 122 of the client computer processing the client form entry. Arrow 494 directs execution from operation 492 to operation 496. Operation 496 terminates the operations of this flowchart.
The server may send the form to the client computer. The client computer may be operating a browser receiving the sent form as shown in
When the user attempts to submit the form, some JavaScript code may first iterate through each rule that was included in the automatically generated data structures.
Each rule is checked against the appropriate entry field. If there is a violation of the rule, the JavaScript code immediately displays a message without involving the server. The generated data structure includes message text for each rule that can be displayed if the user violates a rule.
Arrow 510 directs the flow of execution from starting operation 132 to operation 512. Operation 512 performs the server computer receiving all the associated server validation rules based upon the form entry with at least one associated validation rule. Arrow 514 directs execution from operation 512 to operation 516. Operation 516 terminates the operations of this flowchart.
Arrow 520 directs the flow of execution from starting operation 132 to operation 522. Operation 522 performs the server computer validating the client form data entry based upon all the associated server validation rules. Arrow 524 directs execution from operation 522 to operation 516. Operation 516 terminates the operations of this flowchart.
When the server receives a posted form, it iterates through each of the rules defined for that set. If there is a violation of the rule, the server responds to the client with an error message.
Certain embodiments of the invention include a method of using a form containing at least one form entry with at least one associated validation rule performing data validation by both a server computer and a client computer.
Arrow 600 directs the flow of execution from starting operation 100 to operation 602. Operation 602 performs client computer operations supporting the method using the form and validating the form entries with at least one validation rule. Arrow 604 directs execution from operation 602 to operation 606. Operation 606 terminates the operations of this flowchart.
Arrow 610 directs the flow of execution from starting operation 100 to operation 612. Operation 612 performs server computer operations supporting the method using the form and validating the form entries with at least one validation rule. Arrow 614 directs execution from operation 612 to operation 606. Operation 606 terminates the operations of this flowchart.
Arrow 630 directs the flow of execution from starting operation 602 to operation 632. Operation 632 performs receiving a client form containing at least one client form entry with at least one associated local client rule based upon the form containing the at least one form entry with at least one s associated validation rule. Arrow 634 directs execution from operation 632 to operation 636. Operation 636 terminates the operations of this flowchart.
Arrow 640 directs the flow of execution from starting operation 602 to operation 642. Operation 642 performs processing client data entry based upon the client form to create a client form data entry for the at least one client form entry. Arrow 644 directs execution from operation 642 to operation 636. Operation 636 terminates the operations of this flowchart.
Arrow 650 directs the flow of execution from starting operation 602 to operation 652. Operation 652 performs receiving a submission request from the client to create a form submission request. Arrow 654 directs execution from operation 652 to operation 636. Operation 636 terminates the operations of this flowchart.
Arrow 660 directs the flow of execution from starting operation 602 to operation 662. Operation 662 performs validating the client form entry based upon all the associated local client rules to create a validated client form data entry whenever the client computer receives the form submission request, for each form entry with at least one associated validation rule contained in the form. Arrow 664 directs execution from operation 662 to operation 636. Operation 636 terminates the operations of this flowchart.
Arrow 670 directs the flow of execution from starting operation 602 to operation 672. Operation 672 performs sending all of the validated client form data entries to the server computer to create the sent client form data entry for each form entry with at least one associated validation rule, whenever the client requests form submission and whenever all client form data entries satisfy all of the associated local client rules. Arrow 674 directs execution from operation 672 to operation 636. Operation 636 terminates the operations of this flowchart.
Arrow 770 directs the flow of execution from starting operation 612 to operation 772. Operation 772 performs receiving the sent client form data entry for each form entry with at least one validation rule. Arrow 774 directs execution from operation 772 to operation 776. Operation 776 terminates the operations of this flowchart.
Arrow 780 directs the flow of execution from starting operation 612 to operation 782. Operation 782 performs validating the sent client form data entries based upon all of the associated validation rules, for all form entries with at least one associated validation rule contained in the form. Arrow 784 directs execution from operation 782 to operation 776. Operation 776 terminates the operations of this flowchart.
Arrow 710 directs the flow of execution from starting operation 632 to operation 712. Operation 712 performs the client computer operating a browser downloading a web page based upon the form to create the client form containing a client form entry with all the associated local client rules, for each form entry with at least one associated validation rule contained in the form. Arrow 714 directs execution from operation 712 to operation 716. Operation 716 terminates the operations of this flowchart.
Arrow 730 directs the flow of execution from starting operation 632 to operation 732. Operation 732 performs the client computer receiving the step 642 of the client computer processing client data entry based upon the client form. Arrow 734 directs execution from operation 732 to operation 736. Operation 736 terminates the operations of this flowchart.
Arrow 740 directs the flow of execution from starting operation 632 to operation 742. Operation 742 performs the client computer receiving the step 652 of the client computer receiving the submission request from the client. Arrow 744 directs execution from operation 742 to operation 736. Operation 736 terminates the operations of this flowchart.
Arrow 750 directs the flow of execution from starting operation 632 to operation 752. Operation 752 performs the client computer receiving the step 662 of the client computer validating the client form entry. Arrow 754 directs execution from operation 752 to operation 736. Operation 736 terminates the operations of this flowchart.
Arrow 760 directs the flow of execution from starting operation 632 to operation 762. Operation 762 performs the client computer receiving the step 672 of the client computer sending all of the validated client form data entries. Arrow 764 directs execution from operation 762 to operation 736. Operation 736 terminates the operations of this flowchart.
The preceding embodiments have been provided by way of example and are not meant to constrain the scope of the following claims.
Claims
1. A method of using a form containing at least one form entry with at least one associated validation rule performing data validation by both a server computer and a client computer comprising the steps of:
- the client computer performing the steps of: receiving a client form containing at least one client form entry with all associated local client rules based upon the form containing the at least one form entry with the at least one associated validation rule; processing client data entry based upon the client form to create
- a client form data entry for the client form entry; receiving a submission request from the client to create a form submission request; validating the client form entry based upon all the associated local client rules to create a validated client form data entry whenever the client computer receives the form submission request, for each form entry with at least one associated validation rule contained in the form; sending all of the validated client form data entries to the server computer to create the sent client form data entry for each form entry with at least one associated validation rule, whenever the client requests form submission and whenever all client form data entries satisfy all of the associated local client rules;
- the server computer performing the steps of: receiving the sent client form data entry for each form entry with at least one validation rule; validating the sent client form data entries based upon all of the associated validation rules, for all form entries with at least one associated validation rule contained in the form.
2.-45. (canceled)
Type: Application
Filed: Sep 14, 2012
Publication Date: Mar 14, 2013
Inventor: Sandip Chokshi (San Jose, CA)
Application Number: 13/620,615