SlideShare une entreprise Scribd logo
1  sur  31
Télécharger pour lire hors ligne
EASING
INTO WEB
DEVELOPMENT
4.
4 FORMS
1   INTRODUCTION
    2   HTML
    3   TABLES
    4   FORMS
    5   HTTP
    6   CSS
    7   CSS FRAMEWORKS
    8   DIGITAL MEDIA
2   9   USABILITY
What is a Form?
3


       A form is a way to pass information from a web
        browser to a program on a Web server.
       Forms thus provide two-way communication: from
        the server to the user, and from the user to the
                              ,
        server.
Form data – where does it go?
4


       The data that is input into a f
                                      form is sent back to the
        server as a series of name=value pairs separated
        by
        b ampersands.d
         E.g.   firstname=karl&lastname=marx&price=1.59

       This information is URL encoded, but it is certainly
               f                    d d
        not encypted.
         E.g.   name=karl%20marx

         HTTPS     encypts this information.
       This data is sent either via the url or within the HTTP
        header.
Three Parts of a Form
5


    1. The form that the user sees and enters data into.
         This is constructed with HTML tags
    2. A script for validating the user's entry (optional).
         This runs on the browser
             written in Javascript
    3. A program that processes the user data.
         p g          p
       This resides on the server.
       Typically uses CGI-Perl, ASP, PHP, ASP.NET or some other
         yp      y              ,   ,     ,
        server-side scripting/programming technology & language.
       Also should validate the user’s entry
1. Building the Form in HTML
6


       Two
        T parts
         <form> ... </form> tag
         form elements
               <input>


               <select> and <option>


               <textarea>


               <label>, <legend>, and <fieldset>
Example
7

    <h2>on-line wine buyer</h2>
    <form>
       guest name:
       <input type="text" name="guest" size="40"/><br/>
       e mail:
       e-mail:
       <input type="text" name="email"/><br/>
       color:
       <input type="radio" name="winecolor" value="w"/>white
       <input type="radio" name="winecolor" value="r"/>red
       <input t
       <i    t type="radio" name="winecolor" value="o"/>rose
                    " di "       " i    l "    l   " "/>
       <p>price:
       <select name="price">
          <option>choose a price</option>
          <option>below $10</option>
          <option>between $10 and $20</option>
          <option>above $20</option>
       </select>
       </p>
       <p><input type="submit"/></p>
                  type submit /></p>
    </form>
<form> Tag
8

       While
        Whil you can hhave several <form> ... </f
                                 l <f   > </form> in a page,
                                                  >i
        they cannot be nested
       attributes
           id=
               id of the form (only necessary if more than one form in page)
           action=
              ti
               specifies the URL of the server-side script that will process the form
           method=
               specifies how the information in the form will be transmitted to the
                server. Two possible values:
                     get -        The browser transmits user-entered form data as part
                                   of the URL specified by the ACTION attribute
                                    f h           ifi d b h                 ib
                     post -       Browser transmits form input info as part of the HTTP
                                   header
<form> Tag
9

       Examples
        <form   method="get"    action="cgi-bin/mailform.pl">


        <form   id="personal"     action="validate.asp"   method="post">
Form Elements
10

        There are controls within the <form> ... </form>
         tags
        <input> tag
            attributes
              tt ib t
                name      - necessary for the form to be processed
                type      - specifies type of control

                   type="text"
                   type="password"
                   type="checkbox"
                   type="radio"
                   type="submit"
                   type="reset"

                Other attributes are possible depending upon the type
                 O
                 attribute.
11
          Sample <i
          S   l <input> elements
                      > l
     <input type="text" name="first1">
     <input type="text" name="first2" size="10" maxlength="5">
     <input type="text" name="first3" value="Karl Marx">



     <input type="checkbox" name="chk1"></br/>
     Alive <input type="checkbox" name="chk2"></br/>
     <input type="checkbox" name="chk3">Alive</br/>
            type= checkbox name= chk3 >Alive</br/>
     <input type="checkbox" name="chk3" value="something"><br/>
     <input type="checkbox" name="chk4" checked="checked"><br/>



     <input type="radio" name="sex" value="male"> Male
     <input type="radio" name="sex" value="female"> Female


     <input type="button" name="click" value="Click Me">
     <input type="image" src="images/btn_login.gif" alt="Login">


     <input type="submit"></br/>
     <input type="submit" value="Ok">
            type submit value Ok >
Form Elements, continued
12


        Drop-down menus created with
         D    d                   d ih
         <select> tag
        <select> is a contained for
         <option> tags which define list items
         <select name="price">
           <option>Choose a price</option>
           <option>below $10</option>
           <option>between $10 and $20</option>
           <option>above $20</option>
         </select>
<select> element
13


        What l i
         Wh value is returned from a
                            df
         <select> element?
          Either
            The    value   attribute for the selected
             option
            If no value attribute, then the text of the
             option element
<select> element
14

     <select name="price">
        <option value="0">Choose a price</option>
        <option value="1">below $10</option>               price=1
        <option value="2">between $10 and $20</option>
        <option value="3">above $20</option>
          p                           p
     </select>

     <select name="price">
        <option>Choose a price</option>
        <option>below $10</option>                       price below%20%2410
                                                         price=below%20%2410
        <option>between $10 and $20</option>
        <option>above $20</option>
     </select>
Aligning Form Elements
15




        Be sure to align your form
         elements !!
          l     t
        This can be done via
          tables

          CSS
Align form elements via tables



16
2. Verify Using Client-Side Scripting
                     Client Side
17


        Javascript
          is a programming language introduced by Netscape
           but available on IE, FireFox and Opera.
          is not the same as Java.
Working with Javascript
18


        Typically consists of Javascript f
                             f            functions
         that respond to events connected to
         HTML t tags
         <script language=javascript>
             function check_form() {
               if (email.value == "") {
               if (   il   l      "") {
                  alert("please enter an email")
                  return false
               }
             }
         </script>
         <body>
         <form>
             <input type=submit  onclick="check_form()">
         ...
3. Process Using Server-Side
19
         Program
        Server-side
         Server side programming is necessary to access
         databases, save form data, create customized
         pages
        The most popular are
            PHP (PHP Hypertext Processor)
            ASP.NET
             ASPNET
            CGI (Common Gateway Interface)
            ASP (Active Server Pages)
            JSP (Java Server Pages)
            Cold Fusion
Static Web Content
20

        Browser
        B                                                   Web
                                                           Server




                  Browser requests index.htm from server




                  Server responds by sending index.htm
                  to browser
Dynamic Web Content
21
                                                              Web
       Browser                                               Server
                 1
                 Browser requests
                 processForm.asp from server


                                                                          Server recognizes
                                                                          request as script or
                                                                          program

                                                                            2
                                                         3
                                                                       program
                                Program runs, getting information
                                about the request from the server,
                                interacts with server resources such
                                as databases, and generates
                                   databases
                                response (HTML tags) that is sent
                                back to browser

                 4
                 Browser displays HTML it
                 received from server.
form_example.htm




                    reply.asp
22
REPLY.ASP
     <html><head><title>Form Example</title></head>
     <body>
     <h1>Sample Form ASP Script</h1>
     <B>The following form items were received:</b><p>
     <% for each item in request.form %>
          Form
          Fo m Item '<% =Item %>' has the value '<% =request.form(item) %>'<b >
                         Item              al e      request form(item) %>'<br>
     <% next %>

     </body>
     </html>




                                <html><head><title>Form Example</title></head>
          Generates this code   <body>
                                <h1>Sample Form ASP Script</h1>
                                <B>The following form items were received:</b><p>
                                Form Item 'guest' has the value 'Fred'<br>
                                Form It
                                F    Item ' dd
                                          'address' has the value '123-Anywhere St' b
                                                  ' h   th    l   '123 A    h   St'<br>
                                Form Item 'BUTTON' has the value 'Submit Query'<br>
                                Form Item 'email' has the value 'fred@abc.net'<br>
                                Form Item 'city' has the value 'Calgary'<br>
                                Form Item 'prov' has the value 'AB'<br>
                                Form Item 'phone' has the value ''<br>
                                Form Item 'winecolor' has the value 'R'<br>
                                Form Item 'price' has the value 'between $10 and $20'<br>
                                </body>
                                </html>


23
Form Accessibility
24


        You can improve the accessibility of your forms by
         using
          the         ,          and <legend> elements.
                 <label> <fieldset>,

          the accesskey and tabindex attributes
<label> element
25


          Used to define relationship between the text
           describing the form element and the form element
           itself.
            Unless styled by CSS, is not displayed by the browser.
            If you click the label, then the form element receives the
             focus.
               The   form element must have an id specified for this to work
     First Name: <input type="text" name="firstname"><br>

     <label for="firstname">First Name: </label>
     <input type="text" id="firstname" name="firstname">




                                                            Clicking on label gives form
                                                            element the focus.
<fieldset> and <legend>
26


        The <fieldset> groups a set of related form
         controls together.
          This fieldset can then be visually styled and given a
            label via the <legend> element.
         <fieldset>
           <legend>Login</legend>
           <label for="email">EMail: </label><br>
           <input type="text" name="email"><br>
           <label for= pass >Password: </label><br>
                  for="pass">Password:
           <input type="password" name="pass"><br>
           <input type="button" name="submit" value="Log In">
         </fieldset>
accesskey          and tabindex attributes
27


        accesskey attribute is used to assign an access key
         to the form element that works with the program's
         modifier key (on Windows browsers this is the Alt key).
              f
            Thus <input type="text" name="email"   accesskey="m">   could be given
             the focus b pressing Alt-M.
              h f       by        i Al M
        The tabindex attribute is used to define the
         element's position in the tab order.
                '
            E.g. <input type="text" name="email"   tabindex="1">   would be the first
             element in the tab order.
              l            h     b d
        Links (<a> tag) can also be given these two attributes.
28
<form name="form1" method="" action="">
        <fieldset>
           <legend>Login</legend>

           <label>Your email</label>
           <input type="text" name="email" /><br />
           <label>Your password</label>
           <input type="password" name="password" /><br />
            i          "       d"      "       d" / b /
           <input type="checkbox" name="remember" />
           Remember me<br  />
           <label>Server </label>
           <input type="radio" name="server" value="one"> One
              p    yp
           <input type="radio" name="server" value="two"> Two<br />
           <label>Domain</label>
           <select name="domain">
              <option>Abc</option>
              <option>Def</option>
              <option>Ghi</option>
           </select><br />
           <input type="submit"  />
        </fieldset>
     </form>
      /f

29
30
31

Contenu connexe

Tendances

New Form Element in HTML5
New Form Element in HTML5New Form Element in HTML5
New Form Element in HTML5Zahra Rezwana
 
Form Validation in JavaScript
Form Validation in JavaScriptForm Validation in JavaScript
Form Validation in JavaScriptRavi Bhadauria
 
HTML Forms Tutorial
HTML Forms TutorialHTML Forms Tutorial
HTML Forms TutorialProdigyView
 
html 5 new form attribute
html 5 new form attributehtml 5 new form attribute
html 5 new form attributePriyanka Rasal
 
Forms with html5 (1)
Forms with html5 (1)Forms with html5 (1)
Forms with html5 (1)Anada Kale
 
Html advanced-reference-guide for creating web forms
Html advanced-reference-guide for creating web formsHtml advanced-reference-guide for creating web forms
Html advanced-reference-guide for creating web formssatish 486
 
PHP Form Validation Technique
PHP Form Validation TechniquePHP Form Validation Technique
PHP Form Validation TechniqueMorshedul Arefin
 
Forms With Ajax And Advanced Plugins
Forms With Ajax And Advanced PluginsForms With Ajax And Advanced Plugins
Forms With Ajax And Advanced PluginsManuel Lemos
 
Data validation in web applications
Data validation in web applicationsData validation in web applications
Data validation in web applicationssrkirkland
 
03 the htm_lforms
03 the htm_lforms03 the htm_lforms
03 the htm_lformsIIUM
 
Web forms and html lecture Number 4
Web forms and html lecture Number 4Web forms and html lecture Number 4
Web forms and html lecture Number 4Mudasir Syed
 
Web engineering - HTML Form
Web engineering -  HTML FormWeb engineering -  HTML Form
Web engineering - HTML FormNosheen Qamar
 
Chapter 07 php forms handling
Chapter 07   php forms handlingChapter 07   php forms handling
Chapter 07 php forms handlingDhani Ahmad
 
Php Form
Php FormPhp Form
Php Formlotlot
 
Html tables, forms and audio video
Html tables, forms and audio videoHtml tables, forms and audio video
Html tables, forms and audio videoSaad Sheikh
 

Tendances (20)

New Form Element in HTML5
New Form Element in HTML5New Form Element in HTML5
New Form Element in HTML5
 
Form Validation in JavaScript
Form Validation in JavaScriptForm Validation in JavaScript
Form Validation in JavaScript
 
2. HTML forms
2. HTML forms2. HTML forms
2. HTML forms
 
Chat php
Chat phpChat php
Chat php
 
HTML Forms Tutorial
HTML Forms TutorialHTML Forms Tutorial
HTML Forms Tutorial
 
html 5 new form attribute
html 5 new form attributehtml 5 new form attribute
html 5 new form attribute
 
Forms with html5 (1)
Forms with html5 (1)Forms with html5 (1)
Forms with html5 (1)
 
Php forms
Php formsPhp forms
Php forms
 
Html advanced-reference-guide for creating web forms
Html advanced-reference-guide for creating web formsHtml advanced-reference-guide for creating web forms
Html advanced-reference-guide for creating web forms
 
Html 5 Forms
Html 5 FormsHtml 5 Forms
Html 5 Forms
 
PHP Form Validation Technique
PHP Form Validation TechniquePHP Form Validation Technique
PHP Form Validation Technique
 
Form Validation
Form ValidationForm Validation
Form Validation
 
Forms With Ajax And Advanced Plugins
Forms With Ajax And Advanced PluginsForms With Ajax And Advanced Plugins
Forms With Ajax And Advanced Plugins
 
Data validation in web applications
Data validation in web applicationsData validation in web applications
Data validation in web applications
 
03 the htm_lforms
03 the htm_lforms03 the htm_lforms
03 the htm_lforms
 
Web forms and html lecture Number 4
Web forms and html lecture Number 4Web forms and html lecture Number 4
Web forms and html lecture Number 4
 
Web engineering - HTML Form
Web engineering -  HTML FormWeb engineering -  HTML Form
Web engineering - HTML Form
 
Chapter 07 php forms handling
Chapter 07   php forms handlingChapter 07   php forms handling
Chapter 07 php forms handling
 
Php Form
Php FormPhp Form
Php Form
 
Html tables, forms and audio video
Html tables, forms and audio videoHtml tables, forms and audio video
Html tables, forms and audio video
 

En vedette (8)

How To Create Personal Web Pages On My Web
How To Create Personal Web Pages On My WebHow To Create Personal Web Pages On My Web
How To Create Personal Web Pages On My Web
 
Tips to deal with adolescent behavior- for parents
Tips to deal with adolescent behavior- for parentsTips to deal with adolescent behavior- for parents
Tips to deal with adolescent behavior- for parents
 
10 most amazing railway stations in the world
10 most amazing railway stations in the world10 most amazing railway stations in the world
10 most amazing railway stations in the world
 
KV Pre Boardmathspaper
KV Pre BoardmathspaperKV Pre Boardmathspaper
KV Pre Boardmathspaper
 
Mathematics quotations
Mathematics quotationsMathematics quotations
Mathematics quotations
 
দেশি আলুর বিদেশি স্বাদ
দেশি আলুর বিদেশি স্বাদদেশি আলুর বিদেশি স্বাদ
দেশি আলুর বিদেশি স্বাদ
 
Nutrition: Food, Nutrition and Health
Nutrition: Food, Nutrition and HealthNutrition: Food, Nutrition and Health
Nutrition: Food, Nutrition and Health
 
Montreal Girl Geeks: Building the Modern Web
Montreal Girl Geeks: Building the Modern WebMontreal Girl Geeks: Building the Modern Web
Montreal Girl Geeks: Building the Modern Web
 

Similaire à Web I - 04 - Forms

Implementation of GUI Framework part3
Implementation of GUI Framework part3Implementation of GUI Framework part3
Implementation of GUI Framework part3masahiroookubo
 
331592291-HTML-and-Cascading style sheet
331592291-HTML-and-Cascading style sheet331592291-HTML-and-Cascading style sheet
331592291-HTML-and-Cascading style sheetstephen972973
 
Active server pages
Active server pagesActive server pages
Active server pagesmcatahir947
 
HSC INFORMATION TECHNOLOGY CHAPTER 1 ADVANCED WEB DESIGNING PART III.pdf
HSC INFORMATION TECHNOLOGY CHAPTER 1 ADVANCED WEB DESIGNING PART III.pdfHSC INFORMATION TECHNOLOGY CHAPTER 1 ADVANCED WEB DESIGNING PART III.pdf
HSC INFORMATION TECHNOLOGY CHAPTER 1 ADVANCED WEB DESIGNING PART III.pdfAAFREEN SHAIKH
 
HSC INFORMATION TECHNOLOGY CHAPTER 3 ADVANCED JAVASCRIPT
HSC INFORMATION TECHNOLOGY CHAPTER 3 ADVANCED JAVASCRIPTHSC INFORMATION TECHNOLOGY CHAPTER 3 ADVANCED JAVASCRIPT
HSC INFORMATION TECHNOLOGY CHAPTER 3 ADVANCED JAVASCRIPTAAFREEN SHAIKH
 
10_introduction_php.ppt
10_introduction_php.ppt10_introduction_php.ppt
10_introduction_php.pptGiyaShefin
 
10_introduction_php.ppt
10_introduction_php.ppt10_introduction_php.ppt
10_introduction_php.pptMercyL2
 
[WSO2 Integration Summit Madrid 2019] Integration + Ballerina
[WSO2 Integration Summit Madrid 2019] Integration + Ballerina[WSO2 Integration Summit Madrid 2019] Integration + Ballerina
[WSO2 Integration Summit Madrid 2019] Integration + BallerinaWSO2
 
Html5ppt
Html5pptHtml5ppt
Html5pptrecroup
 
Desenvolvendo APIs usando Rails - Guru SC 2012
Desenvolvendo APIs usando Rails - Guru SC 2012Desenvolvendo APIs usando Rails - Guru SC 2012
Desenvolvendo APIs usando Rails - Guru SC 2012Rafael Felix da Silva
 
CHAPTER 3 JS (1).pptx
CHAPTER 3  JS (1).pptxCHAPTER 3  JS (1).pptx
CHAPTER 3 JS (1).pptxachutachut
 

Similaire à Web I - 04 - Forms (20)

Implementation of GUI Framework part3
Implementation of GUI Framework part3Implementation of GUI Framework part3
Implementation of GUI Framework part3
 
Spsl v unit - final
Spsl v unit - finalSpsl v unit - final
Spsl v unit - final
 
Html forms
Html formsHtml forms
Html forms
 
Chapter09
Chapter09Chapter09
Chapter09
 
Java script
Java scriptJava script
Java script
 
331592291-HTML-and-Cascading style sheet
331592291-HTML-and-Cascading style sheet331592291-HTML-and-Cascading style sheet
331592291-HTML-and-Cascading style sheet
 
Cmsc 100 (web forms)
Cmsc 100 (web forms)Cmsc 100 (web forms)
Cmsc 100 (web forms)
 
Active server pages
Active server pagesActive server pages
Active server pages
 
HSC INFORMATION TECHNOLOGY CHAPTER 1 ADVANCED WEB DESIGNING PART III.pdf
HSC INFORMATION TECHNOLOGY CHAPTER 1 ADVANCED WEB DESIGNING PART III.pdfHSC INFORMATION TECHNOLOGY CHAPTER 1 ADVANCED WEB DESIGNING PART III.pdf
HSC INFORMATION TECHNOLOGY CHAPTER 1 ADVANCED WEB DESIGNING PART III.pdf
 
HSC INFORMATION TECHNOLOGY CHAPTER 3 ADVANCED JAVASCRIPT
HSC INFORMATION TECHNOLOGY CHAPTER 3 ADVANCED JAVASCRIPTHSC INFORMATION TECHNOLOGY CHAPTER 3 ADVANCED JAVASCRIPT
HSC INFORMATION TECHNOLOGY CHAPTER 3 ADVANCED JAVASCRIPT
 
Fm 2
Fm 2Fm 2
Fm 2
 
10_introduction_php.ppt
10_introduction_php.ppt10_introduction_php.ppt
10_introduction_php.ppt
 
Java script
Java scriptJava script
Java script
 
ASP
ASPASP
ASP
 
introduction_php.ppt
introduction_php.pptintroduction_php.ppt
introduction_php.ppt
 
10_introduction_php.ppt
10_introduction_php.ppt10_introduction_php.ppt
10_introduction_php.ppt
 
[WSO2 Integration Summit Madrid 2019] Integration + Ballerina
[WSO2 Integration Summit Madrid 2019] Integration + Ballerina[WSO2 Integration Summit Madrid 2019] Integration + Ballerina
[WSO2 Integration Summit Madrid 2019] Integration + Ballerina
 
Html5ppt
Html5pptHtml5ppt
Html5ppt
 
Desenvolvendo APIs usando Rails - Guru SC 2012
Desenvolvendo APIs usando Rails - Guru SC 2012Desenvolvendo APIs usando Rails - Guru SC 2012
Desenvolvendo APIs usando Rails - Guru SC 2012
 
CHAPTER 3 JS (1).pptx
CHAPTER 3  JS (1).pptxCHAPTER 3  JS (1).pptx
CHAPTER 3 JS (1).pptx
 

Plus de Randy Connolly

Ten-Year Anniversary of our CIS Degree
Ten-Year Anniversary of our CIS DegreeTen-Year Anniversary of our CIS Degree
Ten-Year Anniversary of our CIS DegreeRandy Connolly
 
Careers in Computing (2019 Edition)
Careers in Computing (2019 Edition)Careers in Computing (2019 Edition)
Careers in Computing (2019 Edition)Randy Connolly
 
Facing Backwards While Stumbling Forwards: The Future of Teaching Web Develop...
Facing Backwards While Stumbling Forwards: The Future of Teaching Web Develop...Facing Backwards While Stumbling Forwards: The Future of Teaching Web Develop...
Facing Backwards While Stumbling Forwards: The Future of Teaching Web Develop...Randy Connolly
 
Where is the Internet? (2019 Edition)
Where is the Internet? (2019 Edition)Where is the Internet? (2019 Edition)
Where is the Internet? (2019 Edition)Randy Connolly
 
Modern Web Development (2018)
Modern Web Development (2018)Modern Web Development (2018)
Modern Web Development (2018)Randy Connolly
 
Helping Prospective Students Understand the Computing Disciplines
Helping Prospective Students Understand the Computing DisciplinesHelping Prospective Students Understand the Computing Disciplines
Helping Prospective Students Understand the Computing DisciplinesRandy Connolly
 
Constructing a Web Development Textbook
Constructing a Web Development TextbookConstructing a Web Development Textbook
Constructing a Web Development TextbookRandy Connolly
 
Web Development for Managers
Web Development for ManagersWeb Development for Managers
Web Development for ManagersRandy Connolly
 
Disrupting the Discourse of the "Digital Disruption of _____"
Disrupting the Discourse of the "Digital Disruption of _____"Disrupting the Discourse of the "Digital Disruption of _____"
Disrupting the Discourse of the "Digital Disruption of _____"Randy Connolly
 
17 Ways to Fail Your Courses
17 Ways to Fail Your Courses17 Ways to Fail Your Courses
17 Ways to Fail Your CoursesRandy Connolly
 
Red Fish Blue Fish: Reexamining Student Understanding of the Computing Discip...
Red Fish Blue Fish: Reexamining Student Understanding of the Computing Discip...Red Fish Blue Fish: Reexamining Student Understanding of the Computing Discip...
Red Fish Blue Fish: Reexamining Student Understanding of the Computing Discip...Randy Connolly
 
Constructing and revising a web development textbook
Constructing and revising a web development textbookConstructing and revising a web development textbook
Constructing and revising a web development textbookRandy Connolly
 
Computing is Not a Rock Band: Student Understanding of the Computing Disciplines
Computing is Not a Rock Band: Student Understanding of the Computing DisciplinesComputing is Not a Rock Band: Student Understanding of the Computing Disciplines
Computing is Not a Rock Band: Student Understanding of the Computing DisciplinesRandy Connolly
 
Citizenship: How do leaders in universities think about and experience citize...
Citizenship: How do leaders in universities think about and experience citize...Citizenship: How do leaders in universities think about and experience citize...
Citizenship: How do leaders in universities think about and experience citize...Randy Connolly
 
Thinking About Technology
Thinking About TechnologyThinking About Technology
Thinking About TechnologyRandy Connolly
 
A longitudinal examination of SIGITE conference submission data
A longitudinal examination of SIGITE conference submission dataA longitudinal examination of SIGITE conference submission data
A longitudinal examination of SIGITE conference submission dataRandy Connolly
 
Is Human Flourishing in the ICT World of the Future Likely?
Is Human Flourishing in the ICT World of the Future Likely?Is Human Flourishing in the ICT World of the Future Likely?
Is Human Flourishing in the ICT World of the Future Likely?Randy Connolly
 
Constructing a Contemporary Textbook
Constructing a Contemporary TextbookConstructing a Contemporary Textbook
Constructing a Contemporary TextbookRandy Connolly
 

Plus de Randy Connolly (20)

Ten-Year Anniversary of our CIS Degree
Ten-Year Anniversary of our CIS DegreeTen-Year Anniversary of our CIS Degree
Ten-Year Anniversary of our CIS Degree
 
Careers in Computing (2019 Edition)
Careers in Computing (2019 Edition)Careers in Computing (2019 Edition)
Careers in Computing (2019 Edition)
 
Facing Backwards While Stumbling Forwards: The Future of Teaching Web Develop...
Facing Backwards While Stumbling Forwards: The Future of Teaching Web Develop...Facing Backwards While Stumbling Forwards: The Future of Teaching Web Develop...
Facing Backwards While Stumbling Forwards: The Future of Teaching Web Develop...
 
Where is the Internet? (2019 Edition)
Where is the Internet? (2019 Edition)Where is the Internet? (2019 Edition)
Where is the Internet? (2019 Edition)
 
Modern Web Development (2018)
Modern Web Development (2018)Modern Web Development (2018)
Modern Web Development (2018)
 
Helping Prospective Students Understand the Computing Disciplines
Helping Prospective Students Understand the Computing DisciplinesHelping Prospective Students Understand the Computing Disciplines
Helping Prospective Students Understand the Computing Disciplines
 
Constructing a Web Development Textbook
Constructing a Web Development TextbookConstructing a Web Development Textbook
Constructing a Web Development Textbook
 
Web Development for Managers
Web Development for ManagersWeb Development for Managers
Web Development for Managers
 
Disrupting the Discourse of the "Digital Disruption of _____"
Disrupting the Discourse of the "Digital Disruption of _____"Disrupting the Discourse of the "Digital Disruption of _____"
Disrupting the Discourse of the "Digital Disruption of _____"
 
17 Ways to Fail Your Courses
17 Ways to Fail Your Courses17 Ways to Fail Your Courses
17 Ways to Fail Your Courses
 
Red Fish Blue Fish: Reexamining Student Understanding of the Computing Discip...
Red Fish Blue Fish: Reexamining Student Understanding of the Computing Discip...Red Fish Blue Fish: Reexamining Student Understanding of the Computing Discip...
Red Fish Blue Fish: Reexamining Student Understanding of the Computing Discip...
 
Constructing and revising a web development textbook
Constructing and revising a web development textbookConstructing and revising a web development textbook
Constructing and revising a web development textbook
 
Computing is Not a Rock Band: Student Understanding of the Computing Disciplines
Computing is Not a Rock Band: Student Understanding of the Computing DisciplinesComputing is Not a Rock Band: Student Understanding of the Computing Disciplines
Computing is Not a Rock Band: Student Understanding of the Computing Disciplines
 
Citizenship: How do leaders in universities think about and experience citize...
Citizenship: How do leaders in universities think about and experience citize...Citizenship: How do leaders in universities think about and experience citize...
Citizenship: How do leaders in universities think about and experience citize...
 
Thinking About Technology
Thinking About TechnologyThinking About Technology
Thinking About Technology
 
A longitudinal examination of SIGITE conference submission data
A longitudinal examination of SIGITE conference submission dataA longitudinal examination of SIGITE conference submission data
A longitudinal examination of SIGITE conference submission data
 
Web Security
Web SecurityWeb Security
Web Security
 
Is Human Flourishing in the ICT World of the Future Likely?
Is Human Flourishing in the ICT World of the Future Likely?Is Human Flourishing in the ICT World of the Future Likely?
Is Human Flourishing in the ICT World of the Future Likely?
 
Constructing a Contemporary Textbook
Constructing a Contemporary TextbookConstructing a Contemporary Textbook
Constructing a Contemporary Textbook
 
CSS: Introduction
CSS: IntroductionCSS: Introduction
CSS: Introduction
 

Dernier

Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 

Dernier (20)

Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 

Web I - 04 - Forms

  • 2. 1 INTRODUCTION 2 HTML 3 TABLES 4 FORMS 5 HTTP 6 CSS 7 CSS FRAMEWORKS 8 DIGITAL MEDIA 2 9 USABILITY
  • 3. What is a Form? 3  A form is a way to pass information from a web browser to a program on a Web server.  Forms thus provide two-way communication: from the server to the user, and from the user to the , server.
  • 4. Form data – where does it go? 4  The data that is input into a f form is sent back to the server as a series of name=value pairs separated by b ampersands.d  E.g. firstname=karl&lastname=marx&price=1.59  This information is URL encoded, but it is certainly f d d not encypted.  E.g. name=karl%20marx  HTTPS encypts this information.  This data is sent either via the url or within the HTTP header.
  • 5. Three Parts of a Form 5 1. The form that the user sees and enters data into.  This is constructed with HTML tags 2. A script for validating the user's entry (optional).  This runs on the browser  written in Javascript 3. A program that processes the user data. p g p  This resides on the server.  Typically uses CGI-Perl, ASP, PHP, ASP.NET or some other yp y , , , server-side scripting/programming technology & language.  Also should validate the user’s entry
  • 6. 1. Building the Form in HTML 6  Two T parts  <form> ... </form> tag  form elements  <input>  <select> and <option>  <textarea>  <label>, <legend>, and <fieldset>
  • 7. Example 7 <h2>on-line wine buyer</h2> <form> guest name: <input type="text" name="guest" size="40"/><br/> e mail: e-mail: <input type="text" name="email"/><br/> color: <input type="radio" name="winecolor" value="w"/>white <input type="radio" name="winecolor" value="r"/>red <input t <i t type="radio" name="winecolor" value="o"/>rose " di " " i l " l " "/> <p>price: <select name="price"> <option>choose a price</option> <option>below $10</option> <option>between $10 and $20</option> <option>above $20</option> </select> </p> <p><input type="submit"/></p> type submit /></p> </form>
  • 8. <form> Tag 8  While Whil you can hhave several <form> ... </f l <f > </form> in a page, >i they cannot be nested  attributes  id=  id of the form (only necessary if more than one form in page)  action= ti  specifies the URL of the server-side script that will process the form  method=  specifies how the information in the form will be transmitted to the server. Two possible values:  get - The browser transmits user-entered form data as part of the URL specified by the ACTION attribute f h ifi d b h ib  post - Browser transmits form input info as part of the HTTP header
  • 9. <form> Tag 9  Examples <form method="get" action="cgi-bin/mailform.pl"> <form id="personal" action="validate.asp" method="post">
  • 10. Form Elements 10  There are controls within the <form> ... </form> tags  <input> tag  attributes tt ib t  name - necessary for the form to be processed  type - specifies type of control type="text" type="password" type="checkbox" type="radio" type="submit" type="reset"  Other attributes are possible depending upon the type O attribute.
  • 11. 11 Sample <i S l <input> elements > l <input type="text" name="first1"> <input type="text" name="first2" size="10" maxlength="5"> <input type="text" name="first3" value="Karl Marx"> <input type="checkbox" name="chk1"></br/> Alive <input type="checkbox" name="chk2"></br/> <input type="checkbox" name="chk3">Alive</br/> type= checkbox name= chk3 >Alive</br/> <input type="checkbox" name="chk3" value="something"><br/> <input type="checkbox" name="chk4" checked="checked"><br/> <input type="radio" name="sex" value="male"> Male <input type="radio" name="sex" value="female"> Female <input type="button" name="click" value="Click Me"> <input type="image" src="images/btn_login.gif" alt="Login"> <input type="submit"></br/> <input type="submit" value="Ok"> type submit value Ok >
  • 12. Form Elements, continued 12  Drop-down menus created with D d d ih <select> tag  <select> is a contained for <option> tags which define list items <select name="price"> <option>Choose a price</option> <option>below $10</option> <option>between $10 and $20</option> <option>above $20</option> </select>
  • 13. <select> element 13  What l i Wh value is returned from a df <select> element?  Either  The value attribute for the selected option  If no value attribute, then the text of the option element
  • 14. <select> element 14 <select name="price"> <option value="0">Choose a price</option> <option value="1">below $10</option> price=1 <option value="2">between $10 and $20</option> <option value="3">above $20</option> p p </select> <select name="price"> <option>Choose a price</option> <option>below $10</option> price below%20%2410 price=below%20%2410 <option>between $10 and $20</option> <option>above $20</option> </select>
  • 15. Aligning Form Elements 15  Be sure to align your form elements !! l t  This can be done via  tables  CSS
  • 16. Align form elements via tables 16
  • 17. 2. Verify Using Client-Side Scripting Client Side 17  Javascript  is a programming language introduced by Netscape but available on IE, FireFox and Opera.  is not the same as Java.
  • 18. Working with Javascript 18  Typically consists of Javascript f f functions that respond to events connected to HTML t tags <script language=javascript> function check_form() { if (email.value == "") { if ( il l "") { alert("please enter an email") return false } } </script> <body> <form> <input type=submit  onclick="check_form()"> ...
  • 19. 3. Process Using Server-Side 19 Program  Server-side Server side programming is necessary to access databases, save form data, create customized pages  The most popular are  PHP (PHP Hypertext Processor)  ASP.NET ASPNET  CGI (Common Gateway Interface)  ASP (Active Server Pages)  JSP (Java Server Pages)  Cold Fusion
  • 20. Static Web Content 20 Browser B Web Server Browser requests index.htm from server Server responds by sending index.htm to browser
  • 21. Dynamic Web Content 21 Web Browser Server 1 Browser requests processForm.asp from server Server recognizes request as script or program 2 3 program Program runs, getting information about the request from the server, interacts with server resources such as databases, and generates databases response (HTML tags) that is sent back to browser 4 Browser displays HTML it received from server.
  • 22. form_example.htm reply.asp 22
  • 23. REPLY.ASP <html><head><title>Form Example</title></head> <body> <h1>Sample Form ASP Script</h1> <B>The following form items were received:</b><p> <% for each item in request.form %> Form Fo m Item '<% =Item %>' has the value '<% =request.form(item) %>'<b > Item al e request form(item) %>'<br> <% next %> </body> </html> <html><head><title>Form Example</title></head> Generates this code <body> <h1>Sample Form ASP Script</h1> <B>The following form items were received:</b><p> Form Item 'guest' has the value 'Fred'<br> Form It F Item ' dd 'address' has the value '123-Anywhere St' b ' h th l '123 A h St'<br> Form Item 'BUTTON' has the value 'Submit Query'<br> Form Item 'email' has the value 'fred@abc.net'<br> Form Item 'city' has the value 'Calgary'<br> Form Item 'prov' has the value 'AB'<br> Form Item 'phone' has the value ''<br> Form Item 'winecolor' has the value 'R'<br> Form Item 'price' has the value 'between $10 and $20'<br> </body> </html> 23
  • 24. Form Accessibility 24  You can improve the accessibility of your forms by using  the , and <legend> elements. <label> <fieldset>,  the accesskey and tabindex attributes
  • 25. <label> element 25  Used to define relationship between the text describing the form element and the form element itself.  Unless styled by CSS, is not displayed by the browser.  If you click the label, then the form element receives the focus.  The form element must have an id specified for this to work First Name: <input type="text" name="firstname"><br> <label for="firstname">First Name: </label> <input type="text" id="firstname" name="firstname"> Clicking on label gives form element the focus.
  • 26. <fieldset> and <legend> 26  The <fieldset> groups a set of related form controls together.  This fieldset can then be visually styled and given a label via the <legend> element. <fieldset> <legend>Login</legend> <label for="email">EMail: </label><br> <input type="text" name="email"><br> <label for= pass >Password: </label><br> for="pass">Password: <input type="password" name="pass"><br> <input type="button" name="submit" value="Log In"> </fieldset>
  • 27. accesskey and tabindex attributes 27  accesskey attribute is used to assign an access key to the form element that works with the program's modifier key (on Windows browsers this is the Alt key). f  Thus <input type="text" name="email" accesskey="m"> could be given the focus b pressing Alt-M. h f by i Al M  The tabindex attribute is used to define the element's position in the tab order. '  E.g. <input type="text" name="email" tabindex="1"> would be the first element in the tab order. l h b d  Links (<a> tag) can also be given these two attributes.
  • 28. 28
  • 29. <form name="form1" method="" action=""> <fieldset> <legend>Login</legend> <label>Your email</label> <input type="text" name="email" /><br /> <label>Your password</label> <input type="password" name="password" /><br /> i " d" " d" / b / <input type="checkbox" name="remember" /> Remember me<br  /> <label>Server </label> <input type="radio" name="server" value="one"> One p yp <input type="radio" name="server" value="two"> Two<br /> <label>Domain</label> <select name="domain"> <option>Abc</option> <option>Def</option> <option>Ghi</option> </select><br /> <input type="submit"  /> </fieldset> </form> /f 29
  • 30. 30
  • 31. 31