Java Script Date Object

Slides:



Advertisements
Similar presentations
© Copyright 2012 Hidaya Trust (Pakistan) ● A Non-Profit Organization ● / www,histpk.org Hidaya Institute of Science & Technology
Advertisements

FORM VALIDATION Faheem Ahmed Khokhar. FORM VALIDATION Faheem Ahmed Khokhar.
Tutorial 6 Creating a Web Form
Ch3: Introduction to HTML5 part 2 Dr. Abdullah Almutairi ISC 340 Fall 2014.
CS 299 – Web Programming and Design Overview of JavaScript and DOM Instructor: Dr. Fang (Daisy) Tang.
LOGO Document Object Model (DOM)Document Object Model (DOM) Computer Science & Engineering.
CS 174: Web Programming February 26 Class Meeting Department of Computer Science San Jose State University Spring 2015 Instructor: Ron Mak
. If the PHP server is an server or is aware of which server is the server, then one can write code that s information. –For example,
HTML Forms Validation CS360 Javascript. On to forms processing... The processing of a form is done in two parts: –Client-side at the browser, before the.
Form Handling, Validation and Functions. Form Handling Forms are a graphical user interfaces (GUIs) that enables the interaction between users and servers.
HTML 5 Tutorial Chapter 9 Form Attributes. New Form Attributes HTML5 has several new elements and attributes for forms. New form attributes : autocomplete.
Internet & World Wide Web How to Program, 5/e Copyright © Pearson, Inc All Rights Reserved.
1 Creating Web Forms in HTML Web forms collect information from customers Web forms include different control elements including: –Input boxes –Selection.
JavaScript Teppo Räisänen LIIKE/OAMK HTML, CSS, JavaScript HTML defines the structure CSS defines the layout JavaScript is used for scripting It.
CHAP 3. FORM API.  Forms should still be encapsulated in a element where the basic submission attributes are set.  Forms still send the values of the.
More Events and Validation CS Page/window events CS380 2.
Objects.  Java Script is an OOP Language  So it allows you to make your own objects and make your own variable types  I will not be going over how.
RegExp. Regular Expression A regular expression is a certain way to describe a pattern of characters. Pattern-matching or keyword search. Regular expressions.
ALBERT WAVERING BOBBY SENG. Week 5: More JavaScript  Quiz  Announcements/questions.
Lecture 9 The Basics of JavaScript Boriana Koleva Room: C54
CS 174: Web Programming September 30 Class Meeting Department of Computer Science San Jose State University Fall 2015 Instructor: Ron Mak
HTML - Forms By Joaquin Vila, Ph.D.. Form Tag The FORM tag specifies a fill-out form within an HTML document. More than one fill-out form can be in a.
Introduction.  The scripting language most often used for client-side web development.  Influenced by many programming languages, easier for nonprogrammers.
JavaScript and PHP Validation and Error Handling CHAPTER 17.
12. Regular Expressions. 2 Motto: I don't play accurately-any one can play accurately- but I play with wonderful expression. As far as the piano is concerned,
CS346 Regular Expressions1 Pattern Matching Regular Expression.
JavaScript Syntax, how to use it in a HTML document
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.
10 – Java Script (3) Informatics Department Parahyangan Catholic University.
Java Script Pattern Matching Using Regular Expressions.
Validation using Regular Expressions. Regular Expression Instead of asking if user input has some particular value, sometimes you want to know if it follows.
Unit 11 –Reglar Expressions Instructor: Brent Presley.
HTML5 Forms Forms are used to capture user input …
INT222 – Internet Fundamentals Week 11: RegExp Object and HTML5 Form Validation 1.
Learning Aim C.  In this section we will look at how text, tables, forms and frames can be used in web pages.
Strings Robin Burke IT 130. Outline Objects Strings methods properties Basic methods Form validation.
JavaScript Non Primitive Datatype
JavaScript.
IS1500: Introduction to Web Development
Build in Objects In JavaScript, almost "everything" is an object.
Applied Component I Unit II Introduction of java-script
CS 330 Class 7 Comments on Exam Programming plan for today:
PHP Cookies What is a Cookie?
JavaScript is a programming language designed for Web pages.
Lecture 11. Web Standards Continued
EXCEPTION HANDLING IN SERVER CLIENT PROGRAMMING
In this session, you will learn about:
Principles of Software Development
JAVA Script : Functions Ashima Wadhwa
Barb Ericson Georgia Institute of Technology May 2006
Chapter 19 PHP Part II Credits: Parts of the slides are based on slides created by textbook authors, P.J. Deitel and H. M. Deitel by Prentice Hall ©
SEEM4570 Tutorial 05: JavaScript as OOP
Java Script.
JavaScript Arrays Date
4. Javascript Pemrograman Web I Program Studi Teknik Informatika
Web Programming– UFCFB Lecture 17
BY: SITI NURBAYA ISMAIL FACULTY of COMPUTER and MATHEMATICAL SCIENCES
Pertemuan 11 JavaScript.
Forms Data Entry and Capture
Functions, Regular expressions and Events
JavaScript Form Validation
2017, Fall Pusan National University Ki-Joune Li
Tutorial 10: Programming with javascript
JavaScript Basics What is JavaScript?
JavaScript is a scripting language designed for Web pages by Netscape.
HTML5 Demo ISYS 350.
Javascript data structures
Validation using Regular Expressions
HTML Forms What are clients? What are servers?
Lecture 23: Regular Expressions
Presentation transcript:

Java Script Date Object Created with the new Date( ) Methods allow you to get and set the year, month, day, hour, minute, second, and millisecond fields of the object constructor new Date( ) new Date(milliseconds) new Date(datestring) new Date(year,month,date[,hour,minute,second,millisecond ])

JavaScript Form Validation validate the form submitted by the user because it can have inappropriate values can validate name, password, email, date, mobile number etc fields provides you the facility the validate the form on the client side so processing will be fast than server-side validation

Date Objects <html> <body> current time: <p id="time"></p> <script> window.onload=function(){gettime();} function gettime() { var a=new Date(); var h=a.getHours(); var m=a.getMinutes(); var s=a.getSeconds(); m=checktime(m); s=checktime(s); document.getElementById("time").innerHTML=h+":"+m+":"+s; setTimeout(function(){gettime()},1000); } function checktime(i) { if(i<10) i="0"+i; return i; </script> </body> </html>

JavaScript-Regular Expression A regular expression is an object that describes a pattern of characters. used to perform pattern-matching and "search-and-replace" functions on text Syntax /pattern/modifiers; Example var patt = /w3schools/i /w3schools/i  is a regular expression. w3schools  is a pattern (to be used in a search). i  is a modifier (modifies the search to be case-insensitive).

Modifiers perform case-insensitive and global searches Modifier Description i Perform case-insensitive matching g Perform a global match (find all matches rather than stopping after the first match) m Perform multiline matching Brackets used to find a range of characters

Metacharacters

<html> <body> <p>Click the button to do a global search for word characters in a string.</p> <button onclick="myFunction()">Try it</button> <p id="demo"></p> <script> function myFunction() { var str = "Give 100%!"; var patt1 = /\w/g; var result = str.match(patt1); document.getElementById("demo").innerHTML = result; } </script> </body> </html>