Starting with our inputs, we will add some constraints to enable client-side validation Kuali University: Apply Now Lab 2: Validation and Constraints Lab.

Slides:



Advertisements
Similar presentations
CSCI 6962: Server-side Design and Programming Input Validation and Error Handling.
Advertisements

Lecture 6/2/12. Forms and PHP The PHP $_GET and $_POST variables are used to retrieve information from forms, like user input When dealing with HTML forms.
Tutorial 6 Creating a Web Form
 Copyright I/O International, 2013 Visit us at: A Feature Within from Sales Rep User Friendly Maintenance – with Zip Code.
Developing an Excel Application
Tutorial 8: Developing an Excel Application
HOW TO SUBMIT OFFERS TO THE HOSTING GALLERY For Hosting Providers.
Homework 1 Hints. Homework Tips (General) Go through and do the ENTIRE homework in the same time period – You will use all of the material from chap 1.
Tutorial 7: Using Advanced Functions and Conditional Formatting
Database Design Concepts INFO1408 Term 2 week 1 Data validation and Referential integrity.
Form Handling, Validation and Functions. Form Handling Forms are a graphical user interfaces (GUIs) that enables the interaction between users and servers.
131 Agenda Overview Review Roles Lists Libraries Columns.
Microsoft Office 2003: Advanced 1 ADVANCED MICROSOFT ACCESS Lesson 7 – Modifying Table Design.
PHP Tutorials 02 Olarik Surinta Management Information System Faculty of Informatics.
JavaScript Form Validation
Working with Numbers in Alice - Converting to integers and to strings - Rounding numbers. - Truncating Numbers Samantha Huerta under the direction of Professor.
Page: 1 Creating AJAX-Powered Forms with the Dojo Toolkit Presented By: James Harmon Object Training Group, Inc.
Goal: Ensure you have a working environment for the project 1 Lab 0: Confirm Working Training Instance Instructions 1) Install a copy of virtualbox (
KRAD makes it easy to handle HTML events in your webpage. Kuali University: Apply Now Lab 6: Fun with HTML Events Lab Objectives HTML Events – what are.
Overview of Previous Lesson(s) Over View  ASP.NET Pages  Modular in nature and divided into the core sections  Page directives  Code Section  Page.
DAY 20: ACCESS CHAPTER 5 Tazin Afrin October 29,
Creating a Web Site to Gather Data and Conduct Research.
Dreamweaver – Dreamweaver Extras Web Design Section 8-4 Part or all of this lesson was adapted from the University of Washington’s “Web Design & Development.
Making things appear and disappear like a magician Kuali University: Apply Now Lab 4: Progressive Disclosure Lab Objectives  We’ll cover Progressive Disclosures.
Mail merge I: Use mail merge for mass mailings Perform a complete mail merge Now you’ll walk through the process of performing a mail merge by using the.
1 Data List Spreadsheets or simple databases - a different use of Spreadsheets Bent Thomsen.
 A database is a collection of data that is organized so that its contents can easily be accessed, managed, and updated. What is Database?
Mastering Char to ASCII AND DOING MORE RELATED STRING MANIPULATION Why VB.Net ?  The Language resembles Pseudocode - good for teaching and learning fundamentals.
C# Tutorial -1 ASP.NET Web Application with Visual Studio 2005.
CSC350: Learning Management Systems COMSATS Institute of Information Technology (Virtual Campus)
Database Systems Microsoft Access Practical #2 Making Forms and Reports Nos 215.
It’s all about your mission. Francis Scudellari Trish Perkins Cloud Consultants Validation.
Diagnostic Pathfinder for Instructors. Diagnostic Pathfinder Local File vs. Database Normal operations Expert operations Admin operations.
9-1 COBOL for the 21 st Century Nancy Stern Hofstra University Robert A. Stern Nassau Community College James P. Ley University of Wisconsin-Stout (Emeritus)
An Object-Oriented Approach to Programming Logic and Design Fourth Edition Chapter 4 Looping.
VALIDATION CONTROLS.  Validation Controls are primarily used to validate, or verify the data entered by user into a web form.  Validation controls attempt.
XP Tutorial 8 Adding Interactivity with ActionScript.
CSC350: Learning Management Systems COMSATS Institute of Information Technology (Virtual Campus)
1 Chapter 6: Using Prompts in Tasks and Queries 6.1 Prompting in Projects 6.2 Creating and Using Prompts in Tasks 6.3 Creating and Using Prompts in Queries.
NYS Division of Homeland Security And Emergency Services (DHSES) E-Grants Tutorial Creating an Application for the EOC RFP To access DHSES E-Grants you.
Verification & Validation. Batch processing In a batch processing system, documents such as sales orders are collected into batches of typically 50 documents.
Data Validation while loops. Data validation Programs get input data from different sources All data should be ‘validated’ before the program tries to.
Looking at various Rich Message options in KRAD Kuali University: Apply Now Lab : Rich Messages Lab Objectives Understand what Rich Messages are and how.
Securing and Sharing Workbooks Lesson 11. The Review Tab Microsoft Excel provides several layers of security and protection that enable you to control.
 Shopping Basket  Stages to maintain shopping basket in framework  Viewing Shopping Basket.
Looking at various Rich Message options in KRAD Kuali University: Apply Now Lab : Rich Messages Lab Objectives Understand what Rich Messages are and how.
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
MashupAds Lesson 1: Making a One-Way Widget Example: AT&T Store Locator Widget.
ASSIGNMENT POINTS DUE DATE: Monday NOV 30 JAVASCRIPT, INPUT VALIDATION, REGEX See 2 nd slide for Form See 3 rd next slide for the required features.
1 HTML Forms
José Aponte Public Health Advisor Module 3: Adding Intelligence to Forms 12 June 2012 Epi Info™ 7 Introductory Training Office of Surveillance, Epidemiology,
Let’s demonstrate some KRAD Action Components Kuali University: Apply Now Lab 3: Actions Lab Objectives Understand how to setup an action that invokes.
While loops. Iteration We’ve seen many places where repetition is necessary in a problem. We’ve been using the for loop for that purpose For loops are.
Beginning ASP.NET in C# and VB Chapter 9
Tutorial 6 Creating a Web Form
How To Make Easysite Forms By Joshua Crawley Contact:
1 Terminal Management System Usage Overview Document Version 1.1.
JavaScript, Sixth Edition
Project Management: Messages
Training Documentation – Replacing GSPR with RFQ 2.0
Homework 1 Hints.
Analyzing Table Data.
Data Validation and Protecting Workbook
IS333: MULTI-TIER APPLICATION DEVELOPMENT
This presentation document has been prepared by Vault Intelligence Limited (“Vault") and is intended for off line demonstration, presentation and educational.
Conditions and Ifs BIS1523 – Lecture 8.
Coding Concepts (Basics)
Using screens and adding two numbers - addda.cbl
PCW-09 Vision: Information Center Approval System
Presentation transcript:

Starting with our inputs, we will add some constraints to enable client-side validation Kuali University: Apply Now Lab 2: Validation and Constraints Lab Objectives Understand how validation works in the UI Setup some constraints Demonstrate different types of constraints

Lab 2 Validation and Constraints Now that we have the sections and InputFields set up, lets add some constraints Constraints allow us to apply validations to our InputFields All validations performed by constraints are supported on the client-side (as well as the server side through a validation service) The user will immediately see the result of constraint validation when they make a mistake, allowing them to fix it easily Attempting to submit a form without fixing errors will halt that action and give the user a summary of fields/sections that have errors All of this functionality is automatic by just setting up your constraints on your InputFields! 2

Instructions 1) Open up the file view definition file TrainingApplicationView-Lab2.xml 2) Find the field that has a validCharactersConstraint on it (the firstName property field). This InputField is applying an AlphaPatternConstraint to its input (users can only enter alpha characters for this field) 3 Lab 2 Validation and Constraints 3) Copy the validCharactersConstraint property (and its inner content) 4) Let’s put this same constraint on other InputFields where it makes sense: Add it to the lastName, city, and state InputFields.

Instructions 5) Let’s add some more validCharactersConstraints to the other fields. Following the same validCharactersConstraint property process, add different constraints for: - AddressPatternConstraint zip – ZipcodePatternConstraint address1 - AlphaNumericWithBasicPunc address2 – AlphaNumericWithBasicPunc dob - BasicDatePatternConstraint 6) Now find the firstName field again. You may have noticed a property called “required” set with “true”. This constraint property means that this field is required by the user to fill out before the form can be submitted. Add this property to every InputField on the View besides the field campus, address2, and List. 4 Lab 2 Validation and Constraints 7) Additionally, add the property minLength and maxLength to the zip InputField and set both minLength to “5” and maxLength to “10”. These constraints will ensure the user enters only 5-10 characters in this field. Do the same for the state InputField, but set both the values to “2”. 8) Start up your application and see the result of the validation constraints you added by typing in invalid input or skipping required fields. Then see the result of correcting the invalid input.

Solution:

Partial Solution - Your code should look approximately like this: 6 Lab 2 Validation and Constraints

Partial Solution - Your code should look approximately like this : 7 Lab 2 Validation and Constraints

Advanced Features:

9 Lab 2 Extra Info and Exercises There are additional constraints that you can apply for even more types of validations:  exclusiveMin, inclusiveMax (for minimum and maximum numeric values)  Prerequisite Constraints  Must Occur Constraints  Case Constraints  Additional validCharactersConstraint options You can even apply constraints based on the “state” of an object through State-based Validation

Lab 2 Extra Info and Exercises Prerequisite Constraints A prerequisite constraint defines what fields must be filled out WITH this field. Extra Exercise 1: 1) Let’s add a PrerequisiteConstraint for address2, requiring that address1 be filled out before you can fill out address2. 2) Set the “dependencyConstraints” property on the InputField to the following: 3) Start the app and see what happens when you try to fill out address2 after putting nothing in address1 10

Lab 2 Extra Info and Exercises Must Occur Constraints Must Occur Constraints MustOccurConstraint is used to identify fields that are required before this field can be filled out. This differs from PrerequisiteConstraints because the number of fields required from different sets of fields can be defined. MustOccurConstraint is used to identify fields that are required before this field can be filled out. This differs from PrerequisiteConstraints because the number of fields required from different sets of fields can be defined. 11  This means that field11 OR field12 with field13 must be filled out before the field this constraint applies to can have a value. This particular constraint as defined here also allows all 3 fields to be filled out.  This means that field11 OR field12 with field13 must be filled out before the field this constraint applies to can have a value. This particular constraint as defined here also allows all 3 fields to be filled out. However, if max at the top level was 1 instead, it would mean: either field11 OR field12 with field13 must be filled out (all 3 together not allowed). However, if max at the top level was 1 instead, it would mean: either field11 OR field12 with field13 must be filled out (all 3 together not allowed).

Lab 2 Extra Info and Exercises Case Constraints Case Constraints A CaseConstraint provides the ability to only apply a certain constraint when a defined case/condition is satisfied. A CaseConstraint provides the ability to only apply a certain constraint when a defined case/condition is satisfied. The constraint or constraints used can be any of the constraints discussed, in addition to nesting another CaseConstraint within itself. The constraint or constraints used can be any of the constraints discussed, in addition to nesting another CaseConstraint within itself. Extra Exercise 2: Extra Exercise 2: 1) Let’s add a CaseConstraint for campus, making it required when college equals “csc” or “art”. 1) Let’s add a CaseConstraint for campus, making it required when college equals “csc” or “art”. 2) By default, CaseConstraint does an equals comparison. We set the propertyName on CaseConstraint to “college” and fill out the rest of the constraint to look like this  2) By default, CaseConstraint does an equals comparison. We set the propertyName on CaseConstraint to “college” and fill out the rest of the constraint to look like this  3) Start up the app and see that campus 3) Start up the app and see that campus is required when you select csc or art. is required when you select csc or art. 12 art csc

Lab 2 Extra Info and Exercises Notes on Case Constraints There is a list of WhenConstraints in case constraints, by adding additional WhenConstraints, it is equivalent to OR (if this property equals value A apply this constraint OR if this property equals value B apply this other constraint). By adding nested CaseConstraints within WhenConstraints it is equivalent to AND (if this property equals value A AND this other property equals value B, then apply this constraint) CaseConstraint also allows other operators other than equals: NOT_EQUAL, GREATER_THAN_EQUAL, LESS_THAN_EQUAL, GREATER_THAN, LESS_THAN, and HAS_VALUE (has value means has any value) 13

14 Lab 2 Extra Info and Exercises AlphaNumericPatternConstraint AlphaPatternConstraint AnyCharacterPatternConstraint CharsetPatternConstraint NumericPatternConstraint AlphaNumericWithBasicPunc AlphaWithBasicPunc NumericWithOperators FixedPointPatternConstraint IntegerPatternConstraint DatePatternConstraint BasicDatePatternConstraint FloatingPointPatternConstraint PhoneNumberPatternConstraint TimePatternConstraint Time24HPatternConstraint UrlPatternConstraint NoWhitespacePatternConstraint JavaClassPatternConstraint AddressPatternConstraint TimestampPatternConstraint YearPatternConstraint MonthPatternConstraint ZipcodePatternConstraint All Available default ValidCharactersConstraints (many have options to customize further):

15 Lab 2 Extra Info and Exercises In addition to the above defined ValidCharacterConstraints, you can define your own ValidCharactersConstraint by defining the regex property “value” directly. Custom configurations must have a messageKey defined. All Available default ValidCharactersConstraints (many have options to customize further): <bean parent="Uif-InputField" p:instructionalText="custom valid characters constraint - this one accepts only 1 alpha character followed by a period and then followed by a number (a.8, b.0, etc)" p:propertyName="field1"> <bean parent="ValidCharactersConstraint" p:value="^[a-zA-Z]\.[0-9]$" p:messageKey="validation.aDotNumTest"/> Bonus Exercise: Change one of your InputFields to use a customized ValidCharactersConstraint that you define the regex for (just set messageKey to the validation message you want to display for invalid input – messageKey is an additional topic entirely)