JavaScript and Dreamweaver Examples



Similar documents
Internet Technologies

c. Write a JavaScript statement to print out as an alert box the value of the third Radio button (whether or not selected) in the second form.

2- Forms and JavaScript Course: Developing web- based applica<ons

Intell-a-Keeper Reporting System Technical Programming Guide. Tracking your Bookings without going Nuts!

CS412 Interactive Lab Creating a Simple Web Form

Working with forms in PHP

HTML Forms. Pat Morin COMP 2405

Further web design: HTML forms

<option> eggs </option> <option> cheese </option> </select> </p> </form>

Mul$media im Netz (Online Mul$media) Wintersemester 2014/15. Übung 06 (Nebenfach)

«W3Schools Home Next Chapter» JavaScript is THE scripting language of the Web.

Dynamic Web-Enabled Data Collection

Web Development 1 A4 Project Description Web Architecture

JavaScript: Arrays Pearson Education, Inc. All rights reserved.

Website Login Integration

FORM-ORIENTED DATA ENTRY

JavaScript Basics & HTML DOM. Sang Shin Java Technology Architect Sun Microsystems, Inc. sang.shin@sun.com

JavaScript: Introduction to Scripting Pearson Education, Inc. All rights reserved.

Client-side Web Engineering From HTML to AJAX

Implementing Specialized Data Capture Applications with InVision Development Tools (Part 2)

ANGULAR JS SOFTWARE ENGINEERING FOR WEB SERVICES HASAN FAIZAL K APRIL,2014

HTML Form Widgets. Review: HTML Forms. Review: CGI Programs

HTML Forms and CONTROLS

Script Handbook for Interactive Scientific Website Building

Nome database: reddito

How Changes in MS Internet Explorer Version 8 Will Affect Web Pages Containing Input type=file

LAB MANUAL CS (22): Web Technology

Viewing Form Results

JavaScript: Control Statements I

Configuring iplanet 6.0 Web Server For SSL and non-ssl Redirect

InPost UK Limited GeoWidget Integration Guide Version 1.1

Lab 5 Introduction to Java Scripts

Introduction to Web Design Curriculum Sample

In order for the form to process and send correctly the follow objects must be in the form tag.

Yandex.Widgets Quick start

Web Development CSE2WD Final Examination June (a) Which organisation is primarily responsible for HTML, CSS and DOM standards?

HTML Tables. IT 3203 Introduction to Web Development

PHP Form Handling. Prof. Jim Whitehead CMPS 183 Spring 2006 May 3, 2006

How to Create Dynamic HTML and Javascript using your Data Jennifer Sinodis, Bank One, Phoenix, AZ

07 Forms. 1 About Forms. 2 The FORM Tag. 1.1 Form Handlers

CGI Programming. What is CGI?

ABSTRACT INTRODUCTION %CODE MACRO DEFINITION

Introduction to XHTML. 2010, Robert K. Moniot 1

People Data and the Web Forms and CGI. HTML forms. A user interface to CGI applications

Website Planning Checklist

Online Multimedia Winter semester 2015/16

JavaScript Introduction

Technical University of Sofia Faculty of Computer Systems and Control. Web Programming. Lecture 4 JavaScript

JavaScript By: A. Mousavi & P. Broomhead SERG, School of Engineering Design, Brunel University, UK

Novell Identity Manager

Government Girls Polytechnic, Bilaspur

Website Implementation

Real SQL Programming 1

Chapter 2 HTML Basics Key Concepts. Copyright 2013 Terry Ann Morris, Ed.D

Mobile Web Applications. Gary Dubuque IT Research Architect Department of Revenue

Now that we have discussed some PHP background

Web Hosting Prep Lab Homework #2 This week: Setup free web hosting for your project Pick domain name and check whether it is available Lots of free

Inserting the Form Field In Dreamweaver 4, open a new or existing page. From the Insert menu choose Form.

Chapter 2: Interactive Web Applications

Fortigate SSL VPN 4 With PINsafe Installation Notes

Tutorial 6 Creating a Web Form. HTML and CSS 6 TH EDITION

Configuring IBM WebSphere Application Server 7.0 for Web Authentication with SAS 9.3 Web Applications

Understanding Cross Site Scripting

Step by step guides. Deploying your first web app to your FREE Azure Subscription with Visual Studio 2015

Web Design and Development ACS Chapter 13. Using Forms 11/30/2015 1

Reproductions supplied by EDRS are the best that can be made from the original document.

ecommercesoftwareone Advance User s Guide -

Slide.Show Quick Start Guide

Forms, CGI Objectives. HTML forms. Form example. Form example...

Fortigate SSL VPN 3.x With PINsafe Installation Notes

Web Programming with PHP 5. The right tool for the right job.

Sample HP OO Web Application

Multimedia im Netz Online Multimedia Winter semester 2015/16. Tutorial 03 Major Subject

IMRG Peermap API Documentation V 5.0

Setup Guide

Overview. In the beginning. Issues with Client Side Scripting What is JavaScript? Syntax and the Document Object Model Moving forward with JavaScript

Chapter 22 How to send and access other web sites

Introduction to Server-Side Programming. Charles Liu

AJAX The Future of Web Development?

TCP/IP Networking, Part 2: Web-Based Control

MASTERTAG DEVELOPER GUIDE

PHP Tutorial From beginner to master

Using Form Tools (admin)

The purpose of jquery is to make it much easier to use JavaScript on your website.

JAVASCRIPT AND COOKIES

Web Development and Core Java Lab Manual V th Semester

Visualizing a Neo4j Graph Database with KeyLines

How to Make a Working Contact Form for your Website in Dreamweaver CS3

Tutorial: Using PHP, SOAP and WSDL Technology to access a public web service.

Programming the Web 06CS73 SAMPLE QUESTIONS

<script type="text/javascript"> var _gaq = _gaq []; _gaq.push(['_setaccount', 'UA ']); _gaq.push(['_trackpageview']);

Direct Post Method (DPM) Developer Guide

Apply PERL to BioInformatics (II)

Web design. FDC Workshop: WebPage Design. Agenda. All you wanted to know about designing your own personal webpage without daring ask about it!

Web Design with Dreamweaver Lesson 4 Handout

Getting Started with SitePal

HTML Application Creation. Rich Loen CTO, InGenius June 26, 2007

Dynamic Web Pages With The Embedded Web Server. The Digi-Geek s AJAX Workbook

Using Object- Oriented JavaScript

A Tale of the Weaknesses of Current Client-side XSS Filtering

Transcription:

JavaScript and Dreamweaver Examples CSC 103 October 15, 2007 Overview The World is Flat discussion JavaScript Examples Using Dreamweaver HTML in Dreamweaver JavaScript Homework 3 (due Friday) 1

JavaScript in Dreamweaver Dreamweaver Keyserved application HTML Used to create web pages Syntax uses < > (tags) JavaScript works with HTML JavaScript The high-level language we will use 2

Right-click on webpage and View Page Source 3

Paste HTML code into Dreamweaver Steps to Follow for Examples Open Example from the course page http://www.science.smith.edu/~jcardell/courses/csc103/ Enter requested information Right-click and select view page source Copy and paste the HTML into Dreamweaver Save this file to your H: drive with.htm or.html extension 4

Hierarchy of Languages SimCirto Pippin to Dreamweaver and JavaScript: High level languages: FORTRAN, C, Python, JS Assembly language Machine language Hardware, circuits How Computers Work: Semester Overview (Two paths for class discussions) Conceptual Analysis Complexity What computers are and what they do How computers are evolving How computers affect us Hardware: Digital circuits Software: Software: JavaScript Assembly language and Dreamweaver Projects / Reports Discussions on Artificial Intelligence, and the Web Physical Analysis 5

Homework Example: Zipcode Checker Homework Example: Zipcode Checker 6

Homework Example: Zipcode Checker Homework Example: Zipcode Checker 7

Homework Example: Zipcode Checker Programming: Pippin to JavaScript Categories of instructions (quiz 3) Data flow Arithmetic and logic Program control In Pippin, each instruction is in a single category In JavaScript, one line of code main contain all three types of instructions 8

Programming: Pippin to JavaScript Pippin in class example if (W == 0) Note the == Z = 1 Z = 2 JavaScript zipcode checker homework if (Zip.value is not a number) Note.value write ( That is not a number! ) write ( You entered a number. ) Programming: Pippin to JavaScript JavaScript zipcode checker homework if (Zip.value is not a number) write ( That is not a number! ) write ( You entered a number. ) Actual JavaScript code if (isnan(parseint(zip.value))) Ans.value += "\nthat is not a number!\n"; Ans.value += "\nyou entered a number.\n"; 9

Programming: Pippin to JavaScript Actual JavaScript code if (isnan(parseint(zip.value))) Ans.value += "\nthat is not a number!\n"; Ans.value += "\nyou entered a number.\n"; JavaScript details NaN = not a number += is for assignment \n = new line = enter.value Homework Example: HTML Forms 10

Using HTML and Forms We will use HTML forms for Input text box, buttons radio buttons, drop-down menus Action onclick onmouseover Output textarea alert box JS Zipcode Program: <body> <body> <form name="zipform"> Enter your zipcode: <input type ="text" name ="ZipAns" > <input type ="button" name ="B1" value ="Check Zipcode" onclick=" JavaScript:CheckZip()"; > <p> Results: <br> <textarea name = "Response" rows = 4 cols = 50 > </textarea> </body> 11

If-Else Example Simpler than homework No details in <head> </head> section Input Prompt Action User typing in a response Output Alert http://www.science.smith.edu/~jcardell/courses/csc103/ If-Else Example: Initial Prompt 12

If-Else Example: If Correct Answer If-Else Example: Else Incorrect Answer 13

If-Else Example <html> <head> <title>if - Else Control Structure</title> </head> <body> <script language="javascript type="text/javascript"> document.write("<h1>basic Addition I</h1>") var response = parseint(prompt("what is 100 + 50?", "")) if (response == 150) { alert("that is correct! 100 + 50 = 150") } { alert("wrong! 100 + 50 = 150") } </script> </body> </html> Homework: JS Zipcode Program <html> <head> <title>csc 103 HW4: Zipcode Checker</title> function CheckZip() { var Zip = document.zipform.zipans; var Ans = document.zipform.response; // Keep track of the number of tries Count++; Ans.value = Count + ". You entered " + Zip.value; // Confirm that the input is a number if (isnan(parseint(zip.value))) Ans.value += "\nthat is not a number!\n"; Ans.value += "\nyou entered a number.\n"; } </script> </head> <body> <form name="zipform"> Enter your zipcode: <input type ="text" name ="ZipAns" > <input type ="button" name ="B1" value ="Check Zipcode" onclick=" JavaScript:CheckZip()"; > <p> Results: <br> <textarea name = "Response" rows = 4 cols = 50 > </textarea> </form> </body> </html> 14

JS Zipcode Program: <body> <body> <form name="zipform"> Enter your zipcode: <input type ="text" name ="ZipAns" > <input type ="button" name ="B1" value ="Check Zipcode" onclick=" JavaScript:CheckZip()"; > <p> Results: <br> <textarea name = "Response" rows = 4 cols = 50 > </textarea> </body> JS Zipcode Program: <head> <head> <title>csc 103 HW4: Zipcode Checker</title> <script language ="JavaScript"> function CheckZip() { var Zip = document.zipform.zipans; var Ans = document.zipform.response; } Ans.value = "You entered " + Zip.value; // Confirm that the input is a number if (isnan(parseint(zip.value))) Ans.value += "\nthat is not a number!\n"; Ans.value += "\nyou entered a number.\n"; </script> </head> 15

JS Zipcode Program: HW3 *** ASSIGNEMNT for HW3*** Add a second if- statement to check if the length of the number entered is 5 digits. Use.length with the value you are checking to specify the length Building upon Zip.value on previous slide If it is, then output 'Correct length.' If it is not, then your program should output 'A zipcode must have 5 numbers' You will may want to use the newline character \n as above, at the start and end of your text that is output to the screen. 16

JS Zipcode Program: HW3 // Confirm that the input is a number if (isnan(parseint(zip.value))) Ans.value += "\nthat is not a number!\n"; Ans.value += "\nyou entered a number.\n"; // // *** ASSIGNEMNT for HW3*** // add a second if- statement here to check if the length of the number // entered is 5 digits. If it is, then output 'Correct length.' If it is not, // then your program should output 'A zipcode must have 5 numbers' You // will probably want to use the newline character \n as above, at the // start and end of your text that is output to the screen. // } // ** YOUR CODE HERE ** 17

JS Zipcode Program: HW3 if (isnan(parseint(zip.value))) Ans.value += "\nthat is not a number!\n"; Ans.value += "\nyou entered a number.\n"; // // *** ASSIGNEMNT for HW3*** // add a second if- statement here to check if the length of the number // entered is 5 digits. If it is, then output 'Correct length.' If it is not, // then your program should output 'A zipcode must have 5 numbers' You // will probably want to use the newline character \n as above, at the // start and end of your text that is output to the screen. // } JS Zipcode Program: HW3 if (isnan(parseint(zip.value))) Ans.value += "\nthat is not a number!\n"; Ans.value += "\nyou entered a number.\n"; // // *** ASSIGNEMNT for HW3*** // add a second if- statement here to check if the length of the number // entered is 5 digits. If it is, then output 'Correct length.' If it is not, // then your program should output 'A zipcode must have 5 numbers' You // will probably want to use the newline character \n as above, at the // start and end of your text that is output to the screen. // } if ( ) Ans.value += Ans.value += 18

Summary JavaScript Examples HTML forms Input, action and output Zipcode checker homework 19