HTML5 Forms

July 11, 2024

Forms and their attributes

<form>
All the form elements are placed between this tag

action=”url” – The action attribute points to the URL where the forms information will be submitted<

method=”get” or method=”post”- Forms are sent using either the get or post

Values from the form will be added to the URL specified in the ACTION attribute

GET is used in the following form situations:
– Short forms like search
– When only retrieving data from the server

POST method sends the values as HTTP headers and are used for the following forms:
– Upload forms
– Very long forms
– Forms which contain sensitive data
– When adding or deleting information from a database

If no method is set (POST or GET) the form will default to using the GET method

The <input> element is used to create several types of form controls, the value of the type= attribute will determine what kind is created.

Other form elements and attributes include:

– type=”text” – creates a single line output
– name=” ” – identifies the form control for the server
– mexlength=” ” – used to limit the number of characters on a form
– type=”password” – single line text that blocks the input
– element creates a multiline form, text that is coded between the opening and closing tags will appear in the form box
– type=”radio” – creates radio buttons of which only one can be selected
– value=” ” – indicates the value sent to the server of the selected button
– <selected> – this attribute can be used to have a button selected when the page loads
– type=”checkbox” – allows selection of one or more options
– <select> – creates a drop down list
<option> – used with the select element to create options the user can choose
– size=” ” can be used with select to set how many drop down options can be seen
– <multiple=”multiple”> – allows users the pick more than one drop down option
<input> – element is used to allow file uploads
– type=”file” – creates an upload form, method must be set as POST
– type=”submit” – creates a submit button
– type=”image” – can be used to create an image submit button
– type=”hidden” – hides a form on the page
– <button> – element allows more control over button appearance, combine text and image between opening and closing tags
– <label> – identifies the form and helpful for screen readers
– for=” ” – used alongside LABEL and identifies which form it belongs to and allows users to click text
<fieldset> – use to group related forms, browser will show line around group
<legend> – id’s the form group and appears as a form header
– type=”date” – creates a date selection box
– type=”email” – use for email form and also optimizes for smartphone keyboard
– type=”URL” – used when asking for a URL and HTML5 will validate a url as input
– type=”search” – creates a single line search form
– placeholder=” ” – text written in the placeholder attribute shows up in the text form

<html>
    <head>
        <title>Forms</title>
    </head>
    <body>
        <form action="http://www.example.com/review.php" method="get">
            <fieldset>
                <legend>
                    Your Details:
                </legend>
                <label>
                    Name:
                    <input type="text" name="name" size="30" maxlength="100">
                </label>
                <br />
                <label>
                    Email:
                    <input type="email" name="email" size="30" maxlength="100">
                </label>
                <br />
            </fieldset>
            <br />
            <fieldset>
                <legend>
                    Your Review:
                </legend>
                <p>
                    <label for="hear-about">
                        How did you hear about us?
                    </label>
                    <select name="referrer" id="hear-about">
                        <option value="google">Google</option>
                        <option value="friend">Friend</option>
                        <option value="advert">Advert</option>
                        <option value="other">Other</option>
                    </select>
                </p>
                <p>
                    Would you visit again?
                    <br />
                    <label>
                        <input type="radio" name="rating" value="yes" />
                        Yes
                    </label>
                    <label>
                        <input type="radio" name="rating" value="no" />
                        No
                    </label>
                    <label>
                        <input type="radio" name="rating" value="maybe" />
                        Maybe
                    </label>
                </p>
                <p>
                    <label for="comments">
                        Comments:
                    </label>
                    <br />
                    <textarea rows="4" cols="40" id="comments">
                    </textarea>
                </p>
                <label>
                    <input type="checkbox" name="subscribe" checked="checked" />
                    Sign me up for email updates
                </label>
                <br />
                <input type="submit" value="Submit review" />
            </fieldset>
        </form>
    </body>
</html>

DHCP – Information That it Shares

May 14, 2013

The following is a list of the information that a DHCP server will share with hosts.

  • Host IP address
  • Subnet Mask
  • Default Gateway
  • IP Address(es) of any DNS servers

Dynamic Host Control Protocol (DHCP)


Common Types of Ethernet

April 29, 2013

Here is a simlpe table to help you with your CCENT and CCNA exams, remember these!!

TYPE SPEED NAME STANDARD LENGTH
Ethernet 10Mbps 10BaseT IEEE 802.3 Copper 100m
Fast Ethernet 100Mbps 100BaseTX IEEE 802.3a Copper 100m
Gigabit Ethernet 1000Mbps 1000Base SX

1000Base LX

IEEE 802.3e Fibre 550m

Fibre 5km

Gigabit Ethernet 1000Mbps 1000BaseT IEEE 802.3ab Copper 100m

 

 


Spanning Tree Protocol (STP)

April 27, 2013

Switching loops form when multiple paths exist, when a frame is sent and the the frame travels between the switches and never ends up reaching it’s final destination.

STP is used to prevent switching loops and is on by default, it determines a loop free path and ports that are not on the path are put into a blocking mode. If the best path is no longer available STP will calculate a new “path” and ports on that path that where blocked are brought out of the blocking mode.

NB. the shortest physical path is not the best, STP looks at the speed of the links

STP Quick Overview

  • On by default
  • Used to prevent switching loops

 

STP