Filling Out A Web Form e.g. Halawai Scheduling. Top of Form.

Slides:



Advertisements
Similar presentations
Chapter 7 JavaScript: Introduction to Scripting. Outline Simple Programs Objects and Variables Obtaining User Input with prompt Dialogs – –Dynamic Welcome.
Advertisements

JQuery MessageBoard. Lets use jQuery and AJAX in combination with a database to update and retrieve information without refreshing the page. Here we will.
PubMed Limits Here is the Limits page. Searches can be limited by restricting terms to fields or setting specific date or record tagging parameters.
WEB DESIGN TABLES, PAGE LAYOUT AND FORMS. Page Layout Page Layout is an important part of web design Why do you think your page layout is important?
Microsoft Expression Web-Illustrated Unit J: 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.
How to Upload and Submit a Document to Your Tk20 Portfolio Use this when your instructor has asked you to put something in your Tk20 Portfolio (as opposed.
The Web Warrior Guide to Web Design Technologies
D2L Orientation The Sociology of Aging GERON 300 or FCS 330 or SOC Sacramento City College- Jo-Ann Foley.
Office 2003 Introductory Concepts and Techniques M i c r o s o f t Word Web Feature Creating Web Pages Using Word.
CM143 - Web Week 2 Basic HTML. Links and Image Tags.
Using the File Manager WebCT 6. Understanding File Manager The File Manager is the area where all course files are stored. Whenever you link a file in.
CIS101 Introduction to Computing Week 09 Spring 2004.
Purdue Pride Joe Gutierrez Tung Ho Janam Jahavier 3/10/2010Purdue Pride1.
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.
So – You want to learn how to put an advanced article submission (cut and paste) onto the state website. (Note: If you have not done so, you will need.
Internet & World Wide Web How to Program, 5/e Copyright © Pearson, Inc All Rights Reserved.
Client-Side programming with JavaScript 3
Javascript and the Web Whys and Hows of Javascript.
4.1 JavaScript Introduction
JavaScript Form Validation
JS: DOM Form Form Object Form Object –The Form object represents an HTML form. –For each instance of a tag in an HTML document, a Form object is created.
XP Tutorial 6New Perspectives on HTML and XHTML, Comprehensive 1 Creating Web Page Forms Designing a Product Registration Form Tutorial 6.
Department of Information Technology e-Michigan Web Development 0 HTML Form Creation in the Vignette Content Management Application.
2 Alerts and the If/Else Conditional Statement CONTINUED There's No Right Way to Do It There are, literally, a million ways to write any given script.
Homework for October 2011 Nikolay Kostov Telerik Corporation
CIS 451: HTML Frames Adapted from materials developed by Dr. Soe (updated January, 2009)
WEEK 3 AND 4 USING CLIENT-SIDE SCRIPTS TO ENHANCE WEB APPLICATIONS.
CNIT 133 Interactive Web Pags – JavaScript and AJAX JavaScript Environment.
IE 411/511: Visual Programming for Industrial Applications
The Web Wizard’s Guide To JavaScript Chapter 6 Working with Dates and Times.
The Web Wizard’s Guide To JavaScript Chapter 6 Working with Dates and Times.
Using Client-Side Scripts to Enhance Web Applications 1.
Execute Workflow. Home page To execute a workflow navigate to My Workflows Page.
The Control Panel is the starting point when you wish to load files into Blackboard. Students cannot see this panel, unless they know your password of.
1 HTML Forms
ITCS373: Internet Technology Lecture 5: More HTML.
Journalism & Media Studies Graduate Student Culminating Work : Steps for Submitting to the Campus Digital Archive at USFSP November 21, 2011 by Carol Hixson.
JavaScript - A Web Script Language Fred Durao
JavaScript, jQuery, and Mashups Incorporating JavaScript, jQuery, and other Mashups into existing pages.
Tutorial 6 Working with Web Forms. XP Objectives Explore how Web forms interact with Web servers Create form elements Create field sets and legends Create.
My Workspace ELearning in Sakai Randy Graff, PhD HSC Training.
1 HTML Forms
1 JavaScript
Chapter 16 The World Wide Web. FIGURE 16.0.F01: A very, very simple Web page. Courtesy of Dr. Richard Smith.
1 Sacramento City College- Jo-Ann Foley D2L Orientation.
January 2006Colby College ITS Setting Up Course Pages.
Shelcat Scottish Health Libraries Catalogue Training guide, March 2009.
HTML Forms.
D2L Orientation Marriage and the Family FCS 320 or SOC Sacramento City College- Jo-Ann Foley.
HTML-I Basic HTML Elements. HTML (Hyper Text Markup Language) HTML is a document layout and hyperlink- specification language. i.e. a language used to.
Chapter 28. Copyright 2003, Paradigm Publishing Inc. CHAPTER 28 BACKNEXTEND 28-2 LINKS TO OBJECTIVES Table Calculations Table Properties Fields in a Table.
This is the Login Page, From here you can Login to The application via Microsoft account.
JavaScript and Ajax (JavaScript Environment) Week 6 Web site:
1 Agenda  Unit 7: Introduction to Programming Using JavaScript T. Jumana Abu Shmais – AOU - Riyadh.
INTERNET APPLICATIONS CPIT405 JavaScript Instructor: Rasha AlOmari
FORMS Explained By: Jasdeep Kaur. Lecturer, Department of Computer Application, PGG.C.G., Sector: 42, Chandigarh.
14 A Brief Look at JavaScript and jQuery.
IS333: MULTI-TIER APPLICATION DEVELOPMENT
Predefined Dialog Boxes
WEB PROGRAMMING JavaScript.
Integrating JavaScript and HTML
Flight prices.
T. Jumana Abu Shmais – AOU - Riyadh
JavaScript onLoad arrays
Marriage and the Family FCS 320 or SOC 310
The Web Wizard’s Guide To JavaScript
Introduction to JavaScript
Presentation transcript:

Filling Out A Web Form e.g. Halawai Scheduling

Top of Form

A Dozen Widgets to Fill/Select

AppleScript Commands Browser -- Fills a Halawai scheduling page form with the needed information so that it csn be submitted -- Author Jan Stelovsky Copyright 2013 (open source under MIT license) tell application "Safari" -- show the 1st tab of Safari's front window and display the title of its document -- note: clicking Cancel quits tell front window to set current tab to tab 1 set title to do JavaScript "document.getElementsByTagName('title')[0].innerHTML" in document 1 display dialog "Safari opened document \"" & title & "\" in 1-st tab" -- execute the script from a text file set scriptFile to "/Users/jan/Documents/ics/script.txt" set sourceScript to my readFile(scriptFile) do JavaScript sourceScript in document 1 -- ask which course fo fill in set course to display dialog "Choose ICS Course" buttons {"ICS 215", "ICS 665", "Cancel"} default button 3 -- unless Cancelled, fill form with data specific to the selected course if button returned of course is "ICS 665" then set specs to "{title:'ICS 665 UI & Hypermedia', at:'12:00pm-1:15pm', starts:'August 26, 2013', size:14, participants:’ n'}" my fill(specs) else if button returned of course is "ICS 215" then set specs to "{title:'ICS 215 Intro to Scripting', at:'10:00am-11:45am', starts:'August 26, 2013', size:34, participants:’ n'}" my fill(specs) end if end tell -- Ask for lecture number and with 'specs' executes JavaScript script that fills the form page in the browser on fill(specs) set lecture to text returned of (display dialog "Lecture No.:" default answer "") set fillScript to "new FormFiller(" & lecture - 1 & "," & specs & ");" tell application "Safari" to do JavaScript fillScript in document 1 end fill -- Returns the content of the text file 'unixPath' on readFile(unixPath) set textFile to (open for access (POSIX file unixPath)) set content to (read textFile for (get eof textFile)) close access textFile return content end readFile

JavaScript & jQuery Change HTML (1) /* Fills a Halawai scheduling page form with the needed information so that it csn be submitted Author: Jan Stelovsky Copyright 2013 (open source under MIT license) */ // Filler of Halawai scheduling page according to the 'specs' function FormFiller(lecture, specs){ // Initialize // fill/parse 'fields' from 'specs'; define 'date' this.specs = specs; //alert('specs=' + JSON.stringify(specs)); //debug var startDate = new Date(specs.starts); var times = specs.at.split('-'); var from = getTime(times[0]); var to = getTime(times[1]); var date; // generate fields according to specs var fields = [ {type: 'textarea', key:'description'}, {type: 'input', key:'sessiondate'}, {type: 'input', key:'sessiontitle', value:specs.title}, {type: 'select', key:'hour', value:from.hour}, {type: 'select', key:'minute', value:from.minutes}, {type: 'select', key:'ampm', value:from.suffix}, {type: 'select', key:'endhour', value:to.hour}, {type: 'select', key:'endminute', value:to.minutes}, {type: 'select', key:'endampm', value:to.suffix}, {type: 'select', key:'sizelimit', value:specs.size}, {type: 'textarea', key:'participants', value:specs.participants} ]; //alert('fields=' + JSON.stringify(fields)); //debug // once jQuery is loaded, fill the form addJQuery(fillIn); }

JavaScript & jQuery Change HTML (2) // Loads jQuery; when ready call 'doIt' function addJQuery(doIt) { // Waits till jQuery is loaded; if not, initiates another 'waiting' call function waiting(){ if (countDown < 0) { alert("jQuery couldn't be loaded; sorry..."); } else if (typeof $ === 'undefined') { // retry in 1s countDown--; setTimeout(waiting, 1000); } else {doIt();} // jQuery is loaded: go on } var countDown = 10; // if jQuery isn't loaded, appends a that loads it to if (typeof $ === 'undefined') { var body = document.getElementsByTagName('body')[0]; var jQuery = document.createElement('script'); jQuery.setAttribute('src',' body.appendChild(jQuery); // wait till jQuery is loaded waiting(); } else {doIt();} // jQuery is loaded, go on } // Fills all widgets in the page's form with values from 'fields' function fillIn() { update(); $.each(fields, function(dummy, specs){ $(specs.type + '[name="' + specs.key + '"]').val(specs.value); }); //testDates(); }

JavaScript & jQuery Change HTML (3) // Returns 2 digits string of 'number', i.e., prepends '0' to 0..9 function format(number) { return (number < 10 ? '0' : '') + number; } // Returns date of the 'lecture' ordinal // Assumes 2 lectures per week function lectureDate() { var monday = lecture % 2 == 0; // whether it starts on Monday var week = (lecture + (monday ? 0 : -1)) / 2; // 0-indexed //alert((lecture + 1) + '. lecture on ' + (monday ? 'Mon' : 'Wed') + ' of week ' + (week + 1)); //debug var date = new Date(); date.setDate(startDate.getDate() + week * 7 + (monday ? 0 : 2)); return date; } // Returns date in halawai-required format (mm-dd-yyy) function shortDate(date) { // note: while getMonth() is 0-indexed, getDate() is 1-indexed; go figure... return format(date.getMonth() + 1) + '-' + format(date.getDate()) + '-' + date.getFullYear(); } // Updates 'lecture'-dependent items of 'fields' // Note: further improvement would be a better lecture title function update() { fields[0].value = 'Lecture ' + (lecture + 1) + '.'; fields[1].value = shortDate(lectureDate()); //alert('fields=' + JSON.stringify(fields)); //debug } // Test of lectures and dates (visual) function testDates() { toLecture = 17; var dates = ''; for (; lecture <= toLecture; lecture++) { update(); dates += (lecture + 1) + '. lecture' + lectureDate().toDateString() + '\n'; } alert(dates); } // Splits time in hh:mm[am|pm] format into {hour, minutes, suffix} object // Note the use of regular expression function getTime(at) { var parts = at.split(':'); return {hour:Number(parts[0]), minutes:Number(/\d+/.exec(parts[1])[0]), suffix:/[ap]m/.exec(parts[1])[0]}; }

Widgets Filled and/or Selected (1)

Widgets Filled and/or Selected (2)

Widgets Filled and/or Selected (3)

Widgets Filled and/or Selected (4)

Widgets Filled and/or Selected (5)