Form Design & Validation

Slides:



Advertisements
Similar presentations
>> Introduction to HTML: Forms. Introduction to HTML 5 Important HTML Tags HTML tags and attributes Images Hyperlinks Lists –{ordered | unordered | definition}
Advertisements

PHP Workshop ‹#› Forms (Getting data from users).
Forms Review. 2 Using Forms tag  Contains the form elements on a web page  Container tag tag  Configures a variety of form elements including text.
Chapter 10 Form Basics Key Concepts Copyright © 2013 Terry Ann Morris, Ed.D 1.
HTML Forms – Interactive HTML – Web 2.0. HTML – New types for input – Degrades gracefully for browsers that do not support the html 5 input types
Unit 7 – Working with Forms 1. Creating a form 2. Accessing the submitted data 3. Common operations on forms.
Advance Database Management Systems Lab no. 5 PHP Web Pages.
HTML Forms What is a form.
PHP Forms and User Input The PHP $_GET and $_POST variables are used to retrieve information from forms, like user input.
BBK P1 Module2010/11 : [‹#›] Forms (Getting data from users)
LOGO FORMs in HTML CHAPTER 5 Eastern Mediterranean University School of Computing and Technology Department of Information Technology ITEC229 Client-Side.
Week 9 - Form Basics Key Concepts 1. 1.Describe common uses of forms on web pages 2.Create forms on web pages using the form, input, textarea, and select.
HTML and FORMS.  A form is an area that can contain form elements.  Form elements are elements that allow the user to enter information (like text fields,
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 7 TH EDITION Chapter 9 Key Concepts 1 Copyright © Terry Felke-Morris.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 9 Key Concepts 1 Copyright © Terry Felke-Morris.
+ FORMS HTML forms are used to pass data to a server. begins and ends a form Forms are made up of input elements Every input element has a name and value.
Web Forms. Web Forms: A form allows our web visitors to submit information to us. Some examples uses for forms are to let the web user contact us, fill.
Unit 4 Working with data. Form Element HTML forms are used to pass data to a server. A form can contain input elements like text fields, checkboxes, radio-buttons,
Informatics Computer School CS114 Web Publishing HTML Lesson 4.
Chapter 2 Markup Language By : Madam Hazwani binti Rahmat
Oleh: Ahmad Ramadhani, S.Kom
Web Development Part 2.
HTML Basics (Part-3).
Remote hosts and web servers
Web Forms.
Client-Side Internet and Web Programming
Pemrograman WEB I Pertemuan 6.
Making your HTML Page Interactive
Web Forms.
PHP: Forms FdSc Module 109 Server side scripting and Database design
How to Write Web Forms By Mimi Opkins.
Forms Web Design Ms. Olifer.
Web Technologies PHP 5 Basic Language.
FORMS IN HTML.
>> More on HTML Forms
Introduction to Web programming
Lists-Tables-Frames Unit - I.
FORMS Explained By: Sarbjit Kaur.
HTML HTML – Hyper Text Markup Language
Getting User Input with Forms
Passing variables between pages
>> Form Data Retrieval in JavaScript
PHP FORM HANDLING Post Method
Client-Side Internet and Web Programming
HTML/XHTML Forms 18-Sep-18.
Introduction to Web programming
النماذج عند الانتهاء من هذا الدرس ستكون قادرا على:
Designing Forms Lesson 10.
1.5 FORMS.
HTML: Basic Tags & Form Tags
Introduction to Web programming
Creating Form Elements
Creating Form Elements
Web Development & Design Foundations with H T M L 5
Forms Data Entry and Capture
FORM OBJECT When creating an interactive web site for the Internet it is necessary to capture user input and process this input. Based on the result of.
HTML Forms Internet Technology.
HTML Forms Internet Technology.
Principles of Web Design 5th Edition
Intro to Forms HTML forms are used to gather information from end-users. A form can contain elements like radio-buttons, text fields, checkboxes, submit.
HTML Forms 18-Apr-19.
Intro to Forms HTML forms are used to gather information from end-users. A form can contain elements like radio-buttons, text fields, checkboxes, submit.
© Hugh McCabe 2000 Web Authoring Lecture 8
PHP Lecture 11 Kanida Sinmai
Kanida Sinmai HTML Form Kanida Sinmai
Web Forms.
Electronic Commerce HTML forms
Making your HTML Page Interactive
HTML: Basic Tags & Form Tags
CGS 3066: Web Programming and Design Fall 2019
Presentation transcript:

Form Design & Validation Lesson 4 Form Design & Validation

Outlines Form Design Validation

Form Design The HTML <form> element defines a form that is used to collect user input: <form> . form elements . </form>

Form Design The <input> Element Type Description <input type="text"> Defines a one-line text input field <input type="radio"> Defines a radio button (for selecting one of many choices) <input type=“chekbox"> <input type="checkbox"> defines a checkbox <input type="submit"> Defines a submit button (for submitting the form)

Form Design Example 4.1 (Text Input) <html> <body> <h2>Text Input</h2> <form> First name:<br> <input type="text" name="firstname"> <br> Last name:<br> <input type="text" name="lastname"> </form> <p>Note that the form itself is not visible.</p> <p>Also note that the default width of a text input field is 20 characters.</p> </body> </html>

Form Design Example 4.2 (Radio Button Input) <html> <body> <h2>Radio Buttons</h2> <form> <input type="radio" name="gender" value="male" checked> Male<br> <input type="radio" name="gender" value="female"> Female<br> <input type="radio" name="gender" value="other"> Other </form> </body> </html>

Form Design Example 4.3 (Checkbox Input) <h2>Checkboxes</h2> <p>The <strong>input type="checkbox"</strong> defines a checkbox:</p> <form action="/action_page.php"> <input type="checkbox" name="vehicle1" value="Bike">I have a bike <br> <input type="checkbox" name="vehicle2" value="Car">I have a car <br><br> <input type="submit"> </form>

Form Design Example 4.4 (Submit Button) <h2>HTML Forms</h2> <form action="/action_page.php"> First name:<br> <input type="text" name="firstname" value="Mickey"> <br> Last name:<br> <input type="text" name="lastname" value="Mouse"> <br><br> <input type="submit" value="Submit"> </form>

Form Design The <select> element The <select> element defines a drop-down list:

Form Design Example 4.5: (Select Element) <h2>The select Element</h2> <p>The select element defines a drop-down list:</p> <form action="/action_page.php"> <select name="cars"> <option value="volvo">Volvo</option> <option value="saab">Saab</option> <option value="fiat">Fiat</option> <option value="audi">Audi</option> </select> <br><br> <input type="submit"> </form>

Form Design The <textarea> element The <textarea> element defines a multi-line input field (a text area):

Form Design Example 4.6: (Textarea Element) <h2>Textarea</h2> <p>The textarea element defines a multi-line input field.</p> <form action="/action_page.php"> <textarea name="message" rows="10" cols="30">The cat was playing in the garden.</textarea> <br> <input type="submit"> </form>

Form Handling The PHP superglobals $_GET and $_POST are used to collect form-data.

Form Handling Example 4.7 Fig, 4.1. HTML Code <html> <body> <form action="welcome.php" method="post"> Name: <input type="text" name="name"><br> E-mail: <input type="text" name="email"><br> <input type="submit"> </form> </body> </html> Fig, 4.1. HTML Code

Form Handling Fig, 4.2. PHP Code <html> <body> Welcome <?php echo $_POST["name"]; ?><br> Your email address is: <?php echo $_POST["email"]; ?> </body> </html> Fig, 4.2. PHP Code

Form Handling Fig, 4.3. Output Welcome John Your email address is john.doe@example.com Fig, 4.3. Output

Form Handling Example 4.8 Fig, 4.4. HTML Code <html> <body> <form action="welcome_get.php" method="get"> Name: <input type="text" name="name"><br> E-mail: <input type="text" name="email"><br> <input type="submit"> </form> </body> </html> Fig, 4.4. HTML Code

Form Handling Fig, 4.5. PHP Code <html> <body> Welcome <?php echo $_GET["name"]; ?><br> Your email address is: <?php echo $_GET["email"]; ?> </body> </html> Fig, 4.5. PHP Code

Form Handling Fig, 4.6. Output Welcome John Your email address is john.doe@example.com Fig, 4.6. Output

Form Validation (Jquery Validation) This jQuery plugin makes simple clientside form validation easy, whilst still offering plenty of customization options Contact form comes on first priority for any organisation as this may led to establish one to one communication with their customers

Form Validation (Jquery Validation) Example 4.9. (Validation using JQuery) Refer url: https://www.formget.com/jquery-contact-form/