UMass Lowell Dept. of Computer Science

91.461 GUI Programming I

Fall 2015 Semester, Section 201

Prof. Jesse M. Heines

Notes for Class No. 15

Introduction to jQuery (continued)

Thursday, October 22, 2015

A video of this class is (or will be) posted at:   http://echo360.uml.edu/heines201516/guiprogramming1.html


Handouts and Materials

Assignment No. 7 is now posted


Openings / Announcements / Reminders

Quiz on Chapters 1-4 of the JavaScript & jQuery text today

Faculty Advising Period begins next week — Monday, October 26


Class Notes

Related reading for this class:  JS&jQ:TMM Ch. 4, 5 & 9


Form Events  (JS&jQ:TMM p. 263-268)

Various Versions of the Multiplication Table Generator Program


Basic Validation using JavaScript and jQuery

Using the jQuery submit() event handler

1  $(document).ready( function() {
2    tblInitializer.initialize() ;
3    tblGenerator.populateMultiplicationTable_jQuery( "#placeholder", true ) ;
4    $('#frm').submit( function() {   // trap the submit event *before* the action is executed
5      return validateForm() ;  // true = allow action to proceed, false = inhibit action
6    } ) ;
7  } ) ;  // end ready

Writing validation tests

Three pillars of good error messages:

Initializing form fields

Form Validation Demonstration

developed with student Alan Szmyt, Fall 2015 semester

As posted on Piazza, the problem with the code developed in class on Tuesday was simply that the JavaScript tried to populate the “message” paragraph before the page had finished loading.

Note addition to line 60 from what’s on the handout:

   60    if ( parameters !== null && parameters !== "" ) {

Live Demo



This is document http://jesseheines.com:8080/~heines/91.461/91.461-2015-16f/461-lecs/lecture15.jsp.  It was last modified on Friday, August 26, 2022 at 4:09 PM.
Copyright © 2022 by Jesse M. Heines.  All rights reserved.  May be freely copied or excerpted for educational purposes with credit to the author.