CS5220 Advanced Topics in Web Programming More jQuery

Slides:



Advertisements
Similar presentations
HTML Forms. collect information for passing to server- side processes built up from standard widgets –text-input, radio buttons, check boxes, option lists,
Advertisements

WEB PAGES: Create & Maintain Week 12 Creating FORMS.
23-Aug-14 HTML/XHTML Forms. 2 What are forms? is just another kind of XHTML/HTML tag Forms are used to create (rather primitive) GUIs on Web pages Usually.
24-Aug-14 HTML Forms. 2 What are forms? is just another kind of HTML tag HTML forms are used to create (rather primitive) GUIs on Web pages Usually the.
JavaScript & jQuery JavaScript and jQuery introduction.
The jQuery library. What is jQuery ? A javascript lightweight library Is very easy to use Is powerful Is cross-browser compatible Downloadable from jQuery.com,
SE-2840 Dr. Mark L. Hornick1 jQuery. jQuery is a library of JavaScript functions Helps minimize the amount of JavaScript you have to write in order to:
Tutorial 6 Creating a Web Form
1 Topic 6 Processing Form Input. 2Outline Goals and Objectives Goals and Objectives Chapter Headlines Chapter Headlines Introduction Introduction Form.
Chapter 6 Basic forms 1. Forms and query string 2 form : a group of user input (UI) controls that accepts information from the user and sends the information.
Technologies for web publishing Ing. Václav Freylich Lecture 4.
Web Database Programming Input Validation. User Input on the Web Web browser built-in mechanisms –HTML Forms HTTP POST method –Hyperlinks HTTP GET method.
Form Basics CS Web Data  Most interesting web pages revolve around data  examples: Google, IMDB, Digg, Facebook, YouTube, Rotten Tomatoes  can.
CS3L: Introduction to Symbolic Programming Summer 2008 Gilbert Chou Bonus Lecture: Web Programming.
User Interface Design using jQuery Mobile CIS 136 Building Mobile Apps 1.
Web Development & Design Foundations with XHTML Chapter 9 Key Concepts.
Fundamentals, DOM, Events, AJAX, UI Doncho Minkov Telerik Corporation
CSE 154 LECTURE 9: FORMS. Web data most interesting web pages revolve around data examples: Google, IMDB, Digg, Facebook, YouTube, Rotten Tomatoes can.
Form Handling, Validation and Functions. Form Handling Forms are a graphical user interfaces (GUIs) that enables the interaction between users and servers.
CST JavaScript Validating Form Data with JavaScript.
1 Web Developer & Design Foundations with XHTML Chapter 6 Key Concepts.
PhpXperts What is jQuery Javascript Library Fast and concise Simplifies the interaction between HTML and JavaScript.
Nguyen Ich Cuong.  Course duration: 45’  Purpose: Present Introduction to JQuery  Targeted attendees: NICorp Trainee  Tests/quiz: Yes - 10’
Jquery IS JQuery Jquery Example of mouseover event that shows a submenu when menu selected: $(‘#menu’).mouseover(function() { $(‘#submenu’).show();
1 CS 3870/CS 5870 Static and Dynamic Web Pages ASP.NET and IIS.
Chapter 5 Java Script And Forms JavaScript, Third Edition.
Neal Stublen Improvements  New form elements  Assist with validation  Consistency across sites  Changes reduce the need for common.
XHTML Introductory1 Forms Chapter 7. XHTML Introductory2 Objectives In this chapter, you will: Study elements Learn about input fields Use the element.
JQuery Adding behaviour…. Lecture Plan Review of last lesson Adding behaviour –click, mouseover Animation –fade, slideDown Navigation –parent, find, next.
Week 10.  Form controls  Parent containing element for other form control elements  Requires method and action attributes to process the information.
JQUERY | INTRODUCTION. jQuery  Open source JavaScript library  Simplifies the interactions between  HTML document, or the Document Object Model (DOM),
INTRODUCTION TO HTML5 Using jQuery with HTML5. Introducing jQuery  Although it is not a part of any W3C or WHATWG specification, jQuery performs an important.
JavaScript, Fourth Edition Chapter 5 Validating Form Data with JavaScript.
Conor Russomanno & Elizabeth Umbrino. A popular free Javascript Library Released in January 2006 At BarCamp, an international network of user-generated.
Web Development & Design Foundations with XHTML Chapter 9 Key Concepts.
. Taught by: Muhammad Ali Baloch midahot. WHAT IS JQUERY JQuery is a fast, small, and feature-rich JavaScript library. Simplifies the interaction between.
HTML Forms. Slide 2 Forms (Introduction) The purpose of input forms Organizing forms with a and Using different element types to get user input A brief.
JQuery JavaScript is a powerful language but it is not always easy to work with. jQuery is a JavaScript library that helps with: – HTML document traversal.
Form Components and Elements
Copyright © Texas Education Agency, All rights reserved.1 Web Technologies Website Forms / Data Acquisition.
IT204 – Web Scripting and Authoring I Forms and Image Maps Unit 4.
Intro to jQuery. What is jQuery? A JavaScript library Lightweight (about 31KB for the minified version) Simplifies HTML document traversing (DOM), event.
Web Programming Java Script & jQuery Web Programming.
HTML FORMS Basharat Mahmood, Department of Computer Science,CIIT,Islamabad,Pakistan. 1.
Unit 13 –JQuery Basics Instructor: Brent Presley.
Internet & World Wide Web How to Program, 5/e Copyright © Pearson, Inc All Rights Reserved.
Introduction to JQuery COGS 187A – Fall JQuery jQuery is a JavaScript library, and allows us to manipulate HTML and CSS after the page has been.
Mr. Justin “JET” Turner CSCI 3000 – Fall 2015 CRN Section A – TR 9:30-10:45 CRN – Section B – TR 5:30-6:45.
Tutorial 6 Creating a Web Form
Week-11 (Lecture-1) Introduction to HTML programming: A web based markup language for web. Ex.
FORMS Explained By: Jasdeep Kaur. Lecturer, Department of Computer Application, PGG.C.G., Sector: 42, Chandigarh.
JQuery The Write Less, Do More, JavaScript Library.
.. WHAT IS JQUERY JQuery is a fast, small, and feature-rich JavaScript library. Simplifies the interaction between HTML and JavaScript. The jQuery library.
Ashima Wadhwa Java Script And Forms. Introduction Forms: –One of the most common Web page elements used with JavaScript –Typical forms you may encounter.
2440: 141 Web Site Administration Web Forms Instructor: Joseph Nattey.
Creating and Processing Web Forms
Chapter 5 Validating Form Data with JavaScript
Form Data (part 2) MIS 3502, Fall 2015 Jeremy Shafer Department of MIS
CS5220 Advanced Topics in Web Programming JavaScript and jQuery
Objectives Design a form Create a form Create text fields
CS3220 Web and Internet Programming HTML Tables and Forms
CGS 3066: Web Programming and Design Spring 2017
Basic XHTML Tables XHTML tables—a frequently used feature that organizes data into rows and columns. Tables are defined with the table element. Table.
CS3220 Web and Internet Programming Client-Side JavaScript and jQuery
Form Data (part 2) MIS 3501 Jeremy Shafer Department of MIS
CS3220 Web and Internet Programming HTML Tables and Forms
The Internet 10/27/11 XHTML Forms
Chengyu Sun California State University, Los Angeles
Murach's JavaScript and jQuery (3rd Ed.)
Presentation transcript:

CS5220 Advanced Topics in Web Programming More jQuery Chengyu Sun California State University, Los Angeles

Attribute Selectors Exists Value match Value not match Prefix match $(“[name]”) Value match $(“[name=‘a’]”) Value not match $(“[name!=‘a’]”) Prefix match $(“[name|=‘a’]”) Contains word ~= Contains substring *= Starts with ^= Ends with $= All comparisons are case-sensitive.

Form Selectors :input – all input, textarea, select and button elements :button, :checkbox, :file, :image, :password, :radio, :reset, :submit, :text :checked for checkboxes and radio buttons :selected for <option> :enabled :disabled :focused

Hierarchical Selectors Children $(“parent > children”) Descendants $(“ancestor descendants”) Next sibling $(“prev + next”) Next siblings $(“prev ~ siblings”) There is no parent or ancestor selector.

Filters Applied to selectors to further refine the selection Examples: $(“table:last”) $(“p:contains(‘hello’)”) $(“*:hidden”) $(“:hidden”)

Index-Based Filters :first, :last, :even, :odd :eq(n) – nth elements :gt(n) – all elements after the nth element :lt(n) – all elements before the nth elements Index starts from 0.

Child Filters http://api.jquery.com/category/selectors/child-filter-selectors/ <table> <tr><td>1</td><td>2</td><td>3</td></tr> <tr><th>a</th><td>b</td><td>c</td></tr> </table> $(“td:first”) $(“td:eq(1)”) $(“td:first-child”) $(“td:first-of-type”) $(“td:nth-child(1)”) $(“td:nth-of-type(1)”)

Other Filters Contains text Contains element Has child Has no child :has(selector) Has child :parent Has no child :empty No matching :not(selector) State-based filters :focused :animated :hidden :visible

Access Selected Elements .each(function) iterate through the selected elements function(index, element) index: the index of the current element element: current element this: current element The difference between element, this, and $(this)?? .get(index) and .get() retrieve one or all of the selected elements (as an array)

Traversing From selected elements to more (or less) elements Examples: $(“#cell”).closest(“tr”) $(“#row”).find(“td[name=‘foo’]”) $(“div”).filter(“.foo”)

Tree Traversal Find one or more siblings Find children Find parent Find descendants .find() Find Ancestors .parents() Find closet ancestor .closest() Find one or more siblings .prev() .prevAll() .next() .nextAll() .siblings() All methods take an optional selector argument.

Filtering “Filter” is part of selector; “filtering” applies to the selected elements .first(), .last() .eq(), .slice() .has(), not() .filter() – filter by selector, function, or elements

Effects .hide(), .show(), .toggle() Sliding effects Fading effects Custom effects

Example: Taking Attendance j4.html Absence Week 1 Week 2 Week 3 John 1 Jane 2 Tom

jQuery UI http://jqueryui.com/ Widgets Effects Interactions Utilities Themes

jQuery UI on CDN https://code.jquery.com/ Need the JavaScript code and one of the themes

Draggable http://api.jqueryui.com/draggable/ .draggable({ options }) revert: false (default), true, invalid (not dropped on a droppable), valid helper: original (default), clone disabled: false (default), true

Droppable http://api.jqueryui.com/droppable/ .droppable({ options }) accept: selector classes: { “ui-droppable-hover” : CSS class } disabled: false (default), true drop: function(event, ui) ui.draggable represents the draggable element ui.helper represents the helper object

Sortable Reorder elements with drag&drop .sortable({ options }) update: function(event, ui) ui.item represents the moved element ui.helper represents the helper object Use ui.item.index() to get the new position of the item

Example: Drag & Drop j5.html - match programming languages with web frameworks Web Framework Programming Language Spring ASP.NET Django Zend Express Rails C# Ruby Python PHP JavaScript Java