Predefined Dialog Boxes

Slides:



Advertisements
Similar presentations
1 What is JavaScript? JavaScript was designed to add interactivity to HTML pages JavaScript is a scripting language A scripting language is a lightweight.
Advertisements

Objectives Understand the software development lifecycle Perform calculations Use decision structures Perform data validation Use logical operators Use.
The Web Warrior Guide to Web Design Technologies
Tutorial 10 Programming with JavaScript
Repeating Program Instructions Chapter Microsoft Visual Basic.NET: Reloaded 1.
2012 •••••••••••••••••••••••••••••••••• Summer WorkShop Mostafa Badr
Copyright 2007, Information Builders. Slide 1 Maintain & JavaScript: Two Great Tools that Work Great Together Mark Derwin and Mark Rawls Information Builders.
WEB DESIGN AND PROGRAMMING Introduction to Javascript.
Chapter 5 Java Script And Forms JavaScript, Third Edition.
WEEK 3 AND 4 USING CLIENT-SIDE SCRIPTS TO ENHANCE WEB APPLICATIONS.
Javascript. Outline Introduction Fundamental of JavaScript Javascript events management DOM and Dynamic HTML (DHTML)
Chapter 12: How Long Can This Go On?
Tutorial 10 Programming with JavaScript
Using Client-Side Scripts to Enhance Web Applications 1.
Extending HTML CPSC 120 Principles of Computer Science April 9, 2012.
Copyright © Curt Hill First Window Builder Program Easy GUIs in Eclipse.
XP Tutorial 6 New Perspectives on JavaScript, Comprehensive1 Working with Windows and Frames Enhancing a Web Site with Interactive Windows.
JavaScript - A Web Script Language Fred Durao
Copyright ©2005  Department of Computer & Information Science Introducing Dialogue Windows.
Input & Output Functions JavaScript is special from other languages because it can accept input and produce output on the basis of that input in the same.
JavaScript Scripting language What is Scripting ? A scripting language, script language, or extension language is a programming language.
Chapter 2: Variables, Functions, Objects, and Events JavaScript - Introductory.
Dialog boxes in JavaScript Events in JavaScript – What are they – “Which events are there?” – “How do I register event handlers to an HTML element?” –
Copyright © Curt Hill More Components Varying the input of Dev-C++ Windows Programs.
JavaScript, Fourth Edition
Copyright © 2015 Pearson Education, Inc. Publishing as Pearson Addison-Wesley C H A P T E R 13 GUI Programming.
Making dynamic pages with javascript Lecture 1. Java script java versus javascript Javascript is a scripting language that will allow you to add real.
Tutorial 10 Programming with JavaScript. 2New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition Objectives Learn the history of JavaScript.
Chapter 27 Getting “Web-ified” (Web Applications) Clearly Visual Basic: Programming with Visual Basic nd Edition.
Graphical User Interface Components Version 1.1. Obectives Students should understand how to use these basic Form components to create a Graphical User.
Tutorial 10 Programming with JavaScript. 2New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition Objectives Learn the history of JavaScript.
Working with the Window Object JavaScript considers the browser window an object, which it calls the window object.
JavaScript Events Java 4 Understanding Events Events add interactivity between the web page and the user You can think of an event as a trigger that.
1 Lesson 6 Introducing JavaScript HTML and JavaScript BASICS, 4 th Edition.
JavaScript Events. Understanding Events Events add interactivity between the web page and the user Events add interactivity between the web page and the.
CNIT 133 Interactive Web Pags – JavaScript and AJAX Popup Boxes.
1 Agenda  Unit 7: Introduction to Programming Using JavaScript T. Jumana Abu Shmais – AOU - Riyadh.
REEM ALMOTIRI Information Technology Department Majmaah University.
Chapter 5 Validating Form Data with JavaScript
CHAPTER 10 JAVA SCRIPT.
CIIT-Human Computer Interaction-CSC456-Fall-2015-Mr
Topics Graphical User Interfaces Using the tkinter Module
Not a Language but a series of techniques
Tutorial 10 Programming with JavaScript
An Eclipse Plugin for Creating Windows Graphical User Interfaces
Visual Basic Code & No.: CS 218
Apply Procedures to Develop Message, Input, and Dialog Boxes
Console and GUI Programs
JavaScript (JS) Basics
Project 9 Creating Pop-up Windows, Adding Scrolling Messages, and Validating Forms.
Programming the Web using XHTML and JavaScript
Section 17.1 Section 17.2 Add an audio file using HTML
Introduction to Scripting
Repeating Program Instructions
Message, Input, Confirm, and Specialized Dialogs
Microsoft Visual Basic 2005: Reloaded Second Edition
WEB PROGRAMMING JavaScript.
CS18000: Problem Solving and Object-Oriented Programming
Integrating JavaScript and HTML
T. Jumana Abu Shmais – AOU - Riyadh
CIS 16 Application Development Programming with Visual Basic
CS105 Introduction to Computer Concepts
Topics Graphical User Interfaces Using the tkinter Module
Tutorial 10 Programming with JavaScript
Constructors, GUI’s(Using Swing) and ActionListner
First Window Builder Program
An Eclipse Plugin for Creating Windows Graphical User Interfaces
The IF Revisited A few more things Copyright © Curt Hill.
CS105 Introduction to Computer Concepts JavaScript
Presentation transcript:

Predefined Dialog Boxes Enhancing the Browser with GUI Items Copyright © 2008-2015 Curt Hill

What is a Widget? A widget is a name for any graphical user interface component that the user may interact with The common ones include: Buttons Edit boxes Menus Dialog boxes In this case we are interested in Dialog Boxes Copyright © 2008-2015 Curt Hill

Predefined Dialog Boxes Most systems have one or more predefined dialog boxes Easy to generate and use Two common ones in Windows are MessageBox A title and message with several different button combinations InputBox A title and message with an edit box to return results Copyright © 2008-2015 Curt Hill

JavaScript has several Alert One button Gives message to user Prompt Gets input string from user Confirm Returns true/false from one of two buttons Copyright © 2008-2015 Curt Hill

Alert This is a procedure or void function There is one parameter, which is the message to put on the dialog box Format: alert(“You have done something foolish”); If you assign the result of this you get: Undefined Copyright © 2008-2015 Curt Hill

Alert Picture Copyright © 2008-2015 Curt Hill

Page Processing The browser does not display text until it encounters it Thus the previous picture shows that the page is only partially displayed The last lines of the HTML are not shown until the script is complete This is true for all these dialogs Usually these are in event handlers so this is not an issue Copyright © 2008-2015 Curt Hill

Prompt This is a string function There are two parameters The first is the string to display as a message The second is the default value The second is optional Example: v=prompt(“Enter value”,”10”); Copyright © 2008-2015 Curt Hill

Prompt Picture Copyright © 2008-2015 Curt Hill

Prompt Again The item returned is a string However, a string that has a numeric form may be added to as if a numeric Dynamic typing forces a type change The second parameter is optional Leave it out and the edit box is blank In general a default value is better Gives an example of what is wanted Copyright © 2008-2015 Curt Hill

Confirm This is a boolean function There is one parameter The string to display as a message There are two buttons OK – returns true if clicked Cancel – returns false Example: y = confirm("Continue?"); Copyright © 2008-2015 Curt Hill

Confirm Picture Copyright © 2008-2015 Curt Hill

Modal Dialog Boxes All three of these dialog boxes are modal This means that the owning window may not accept input or regain focus until they are gone A modal dialog box must be responded to before anything else goes on Copyright © 2008-2015 Curt Hill

What and why Why would we use these boxes We will use prompt boxes for input values Either string or numeric Alerts for transient output Things you do not want on page Good for debugging Confirm boxes will get boolean input Copyright © 2008-2015 Curt Hill

Finally A predefined dialog box is quick and easy to use You may use Alert to notify the user of something You may use Prompt to get a single input String which can be numericized You may use Confirm to get a Boolean All three are modal, so they cannot be ignored Copyright © 2008-2015 Curt Hill