SlideShare a Scribd company logo
FEWD - WEEK 8
WILL MYERS
Freelance Front End Developer
SLIDES
http://www.slideshare.net/wilkom/fewd-week8-slides
FINAL PROJECT MILESTONE 3
By week 8, you should have submitted a draft of the
JavaScript and jQuery you'll need for your final project. This
week, focus iterating on your project to turn in an updated
draft.
YOUR WEEKLY FEWD GITHUB
REPOSITORY
Use the '+' button in the top-left of GitHub Desktop
(Create tab)
Create a new repository called 'FEWD_Week8'
Choose the [home]/FEWD folder for the local path
Open this repo folder in your editor
Commit the changes and publish the FEWD_Week8
repository to github.com
YOUR WEEKLY WORKING FILES
FROM ME
To get the week8_working_files you should just be able to
select the ga-fewd-files repository in GitHub Desktop and
press 'Sync'. This should pull in this weeks folder from
github.com.
If you any difficulties you should just re-clone the ga-fewd-
files repository.
Copy the whole week8_working_files into your FEWD_Week8
repository and commit and publish to github.com
REVIEW OF LAST WEEK'S
ASSIGNMENT
See also http://learn.shayhowe.com/advanced-html-
css/responsive-web-design/
FORMS
How we can get data from users?
FORMS
A wrapper for data collection elements
Text fields
Dropdowns
Radio Buttons
etc
FORMS
Tells the page:
Where to send the data
How to send it
What is being sent
FORMS - EXERCISE
https://developer.mozilla.org/en-
US/docs/Web/Guide/HTML/Forms/My_first_HTML_form
FORM TAG
Available Attributes
Method: Get, Post, Put, Delete
Action: Url to send data to
Enctype: 'multipart/form-data' if uploading files
FORM TAG
In Action
<form action="register.php" method="post" enctype="multipart/form-data"
<!--Data collection elements go here-->
</form>
INPUTS
Place between <form> </form>tags
Attributes
type: text, submit, password, email, checkbox, button,
radio, file, number, search, etc
name: used server side
placeholder
value
https://developer.mozilla.org/en-
US/docs/Web/HTML/Element/input
INPUTS
Gotchas
The font-family for an input is not inherited!!!
This can lead to funny sizing issues on Macs vs. PCs
where the default font is not the same
TEXT
Use the valueattribute to set initial text
Use the placeholderattribute to set placeholder text
EMAIL
Allows browser to autofill field
PASSWORD
Hides characters as typed
SUBMIT VS FILE VS BUTTON
valueis button text. Defaults to submit in chrome:
<input type="submit" value="Submit">
Creates a file upload element <input type="file">
Creates clickable button <input type="button">
SELECT AND OPTION
SELECT AND OPTION
The <select>tag is for dropdowns and contains
<option>s.
<select>
<option value="option1">first</option>
<option value="option2">second</option>
<select>
The valueattribute represents the value to be submitted
with the form, should this option be selected. If this
attribute is omitted, the value is taken from the text content
of the option element.
<option>first</option> <!-- value is "first" -->
LABELS
Information about the input field should be put in a
<label>tag
To tie the two together choose one of these methods:
<label>Name <input type="text" name="yourName"></label>
<label for="yourName">Name</label>
<input type="text" name="yourName" id="yourName">
NB Usability: Clicking the label text in either case places the
focus in the input field (great for radio buttons)
FIELDSET/LEGEND
<fieldset>is a wrapper for grouped form elements, e.g.
'first', 'middle', 'last' name text fields.
<legend>goes inside fieldset and defines the grouping
term for the fieldset
<fieldset>
<legend>Your Name</legend>
<input type="text" name="first_name">
<input type="text" name="middle_name">
<input type="text" name="last_name">
</fieldset>
STYLING
Styling forms is tricky because form widgets were originally
built to use the underlying operating system UI. CSS was
added for styling other elements some years later.
For a good summary on styling forms, read the following:
https://developer.mozilla.org/en-
US/docs/Web/Guide/HTML/Forms/Styling_HTML_forms
STYLING
The following forms elements are straightforward to style in
the same way that you would style a <p>or a <div>or a
<nav>:
<form>
<fieldset>
<label>
<output>
all text field widgets e.g. (<input>or <textarea>)
all buttons ('submit', 'reset', 'button')
STYLING WORKAROUNDS
The following form elements cannot be styled directly with
CSS
Checkboxes
File upload inputs
Radio buttons
STYLING WORKAROUNDS
There are a number of workarounds for styling 'bad' and
'ugly' form elements
Opacity 0 on the element, set its height and width to
define clickable area, set the height and width of its
parent to be the same as the input (don't forget position
relative). Style the parent.
Hide the element, style a corresponding label how you
wanted the element to appear
STYLING WORKAROUNDS
Try using pseudo elements and the selector :checked for
'no-JS' switching between checked and unchecked
images used for styling
Use JavaScript
STYLING WORKAROUNDS
Let's read the following article and then build a custom
styled checkbox group using one of the techniques from the
previous slide:
https://developer.mozilla.org/en-
US/docs/Web/Guide/HTML/Forms/Advanced_styling_for_HTML
STYLING
Let's have a look at a styled form with a styled <select>
widget, using the following properties to override any
default UI appearance:
appearance:none;
-webkit-appearance:none;
-moz-appearance: none;
Open week8_working_files/form_style
STYLING
Now complete the on the
Mozilla web page.
postcard form styling exercise
VALIDATION
Validation occurs on both the front end and the back end.
The front-end can check for whether a field has been left
blank and whether your password confirmation matches
your password.
Can you write some JavaScript to perform simple validation
for one of the forms we have looked at?
VALIDATION LIBRARIES
Parsley.js is a third party JavaScript library that you can use
for more rigorous front-end validation. It works with jQuery.
http://parsleyjs.org/
http://parsleyjs.org/doc/index.html#psly-frontend-form-
validation
Open week8_working_files/form_style_validation
TODO LIST EXERCISE
Open week8_working_files/to_do_list

More Related Content

What's hot (20)

PDF
forms
tutorialsruby
 
PDF
Fewd week2 slides
William Myers
 
PDF
Lotusphere 2012 Speedgeeking - jQuery & Domino, a RAD Combination
Sean Burgess
 
PDF
Creating Acessible floating labels
Russ Weakley
 
PPTX
Unit f adobe dreamweaver cs6
Krista Lawrence
 
PDF
Baawjsajq109
Thinkful
 
DOCX
Using class suffixes
shailendra vishwakarma
 
PDF
Access tips access and sql part 4 building select queries on-the-fly
quest2900
 
DOCX
Revit drafting procedure
Anima M C
 
PDF
Web app-la-jan-2
Thinkful
 
PPT
Writing a blog post (edublogs)
Paul L
 
PDF
Introduction to-concrete-5
ketanraval
 
PDF
Introduction to-concrete-5
Ketan Raval
 
PPT
Learn CSS From Scratch
ecobold
 
PDF
Build an App with JavaScript and jQuery - LA - July 18
Thinkful
 
PPT
Nvu tutorial1 1
RJOROZCO
 
PDF
Deck 6-456 (1)
Justin Ezor
 
PDF
Using Wordpress with Reclaim Hosting
Cindy Royal
 
PPT
Blog Tutorial
alancarr
 
PDF
Knockout in action
Gerardo Leyes
 
Fewd week2 slides
William Myers
 
Lotusphere 2012 Speedgeeking - jQuery & Domino, a RAD Combination
Sean Burgess
 
Creating Acessible floating labels
Russ Weakley
 
Unit f adobe dreamweaver cs6
Krista Lawrence
 
Baawjsajq109
Thinkful
 
Using class suffixes
shailendra vishwakarma
 
Access tips access and sql part 4 building select queries on-the-fly
quest2900
 
Revit drafting procedure
Anima M C
 
Web app-la-jan-2
Thinkful
 
Writing a blog post (edublogs)
Paul L
 
Introduction to-concrete-5
ketanraval
 
Introduction to-concrete-5
Ketan Raval
 
Learn CSS From Scratch
ecobold
 
Build an App with JavaScript and jQuery - LA - July 18
Thinkful
 
Nvu tutorial1 1
RJOROZCO
 
Deck 6-456 (1)
Justin Ezor
 
Using Wordpress with Reclaim Hosting
Cindy Royal
 
Blog Tutorial
alancarr
 
Knockout in action
Gerardo Leyes
 

Viewers also liked (7)

ODP
trabajo informática
VicentClaudia
 
PPTX
La nanotecnologia
arianator292108
 
ODP
Trabajo de Informática
VicentClaudia
 
ODP
Los sistemas operativos y sus creadores
VicentClaudia
 
PPTX
Fabricantes y sistemas operativos
arianator292108
 
ODP
Creadores de los sistemas operativos
rosarivasruiz
 
PPTX
Sistemas operativos según el fabricante (microsoft,
James Jim Root
 
trabajo informática
VicentClaudia
 
La nanotecnologia
arianator292108
 
Trabajo de Informática
VicentClaudia
 
Los sistemas operativos y sus creadores
VicentClaudia
 
Fabricantes y sistemas operativos
arianator292108
 
Creadores de los sistemas operativos
rosarivasruiz
 
Sistemas operativos según el fabricante (microsoft,
James Jim Root
 
Ad

Similar to Fewd week8 slides (20)

DOC
Cis407 a ilab 2 web application development devry university
lhkslkdh89009
 
PDF
HTML Foundations, pt 3: Forms
Shawn Calvert
 
PDF
forms
tutorialsruby
 
PPT
Rational Publishing Engine with Rational DOORS
GEBS Reporting
 
PDF
SYSTEMS DESIGN / CAPSTONE PROJECT
Sanjay Saluth
 
PPTX
Introduction to Html5, css, Javascript and Jquery
valuebound
 
PDF
Introduction to jQuery
Seble Nigussie
 
PDF
Dojo1.0_Tutorials
tutorialsruby
 
PDF
Dojo1.0_Tutorials
tutorialsruby
 
PPTX
Using prime[31] to connect your unity game to azure mobile services
David Voyles
 
PPTX
Streamlining React Component Development and Sharing with bit.pptx
ShubhamJayswal6
 
PDF
CSS Pseudo Elements.pdf
sonu kumar
 
PDF
Prep 2-booklet-2nd-term-2016-2017
khawagah
 
PPTX
HTML Forms Tutorial
ProdigyView
 
PDF
Documentation For Tab Setup
vkeeton
 
PPT
Ch01
guest7a6cbb3
 
PPT
Android User Interface: Basic Form Widgets
Ahsanul Karim
 
PPT
Chapter 01
Terry Yoast
 
PPT
J Query Public
pradeepsilamkoti
 
Cis407 a ilab 2 web application development devry university
lhkslkdh89009
 
HTML Foundations, pt 3: Forms
Shawn Calvert
 
Rational Publishing Engine with Rational DOORS
GEBS Reporting
 
SYSTEMS DESIGN / CAPSTONE PROJECT
Sanjay Saluth
 
Introduction to Html5, css, Javascript and Jquery
valuebound
 
Introduction to jQuery
Seble Nigussie
 
Dojo1.0_Tutorials
tutorialsruby
 
Dojo1.0_Tutorials
tutorialsruby
 
Using prime[31] to connect your unity game to azure mobile services
David Voyles
 
Streamlining React Component Development and Sharing with bit.pptx
ShubhamJayswal6
 
CSS Pseudo Elements.pdf
sonu kumar
 
Prep 2-booklet-2nd-term-2016-2017
khawagah
 
HTML Forms Tutorial
ProdigyView
 
Documentation For Tab Setup
vkeeton
 
Android User Interface: Basic Form Widgets
Ahsanul Karim
 
Chapter 01
Terry Yoast
 
J Query Public
pradeepsilamkoti
 
Ad

More from William Myers (6)

PDF
Fewd week6 slides
William Myers
 
PDF
Fewd week5 slides
William Myers
 
PDF
Fewd week4 slides
William Myers
 
PDF
Fewd week3 slides
William Myers
 
PDF
Fewd week1 slides
William Myers
 
PDF
Pfnp slides
William Myers
 
Fewd week6 slides
William Myers
 
Fewd week5 slides
William Myers
 
Fewd week4 slides
William Myers
 
Fewd week3 slides
William Myers
 
Fewd week1 slides
William Myers
 
Pfnp slides
William Myers
 

Recently uploaded (20)

PPTX
PE introd.pptxfrgfgfdgfdgfgrtretrt44t444
nepmithibai2024
 
PPTX
L1A Season 1 Guide made by A hegy Eng Grammar fixed
toszolder91
 
PPTX
Orchestrating things in Angular application
Peter Abraham
 
PDF
AI_MOD_1.pdf artificial intelligence notes
shreyarrce
 
PDF
The-Hidden-Dangers-of-Skipping-Penetration-Testing.pdf.pdf
naksh4thra
 
PPT
Computer Securityyyyyyyy - Chapter 2.ppt
SolomonSB
 
PPTX
一比一原版(SUNY-Albany毕业证)纽约州立大学奥尔巴尼分校毕业证如何办理
Taqyea
 
PPT
Computer Securityyyyyyyy - Chapter 1.ppt
SolomonSB
 
PPT
introduction to networking with basics coverage
RamananMuthukrishnan
 
PPTX
L1A Season 1 ENGLISH made by A hegy fixed
toszolder91
 
PDF
𝐁𝐔𝐊𝐓𝐈 𝐊𝐄𝐌𝐄𝐍𝐀𝐍𝐆𝐀𝐍 𝐊𝐈𝐏𝐄𝐑𝟒𝐃 𝐇𝐀𝐑𝐈 𝐈𝐍𝐈 𝟐𝟎𝟐𝟓
hokimamad0
 
PPTX
一比一原版(LaTech毕业证)路易斯安那理工大学毕业证如何办理
Taqyea
 
PPT
introductio to computers by arthur janry
RamananMuthukrishnan
 
PPT
Agilent Optoelectronic Solutions for Mobile Application
andreashenniger2
 
PPTX
ONLINE BIRTH CERTIFICATE APPLICATION SYSYTEM PPT.pptx
ShyamasreeDutta
 
PPTX
法国巴黎第二大学本科毕业证{Paris 2学费发票Paris 2成绩单}办理方法
Taqyea
 
PDF
Build Fast, Scale Faster: Milvus vs. Zilliz Cloud for Production-Ready AI
Zilliz
 
PPTX
Optimization_Techniques_ML_Presentation.pptx
farispalayi
 
PPTX
sajflsajfljsdfljslfjslfsdfas;fdsfksadfjlsdflkjslgfs;lfjlsajfl;sajfasfd.pptx
theknightme
 
PPTX
internet básico presentacion es una red global
70965857
 
PE introd.pptxfrgfgfdgfdgfgrtretrt44t444
nepmithibai2024
 
L1A Season 1 Guide made by A hegy Eng Grammar fixed
toszolder91
 
Orchestrating things in Angular application
Peter Abraham
 
AI_MOD_1.pdf artificial intelligence notes
shreyarrce
 
The-Hidden-Dangers-of-Skipping-Penetration-Testing.pdf.pdf
naksh4thra
 
Computer Securityyyyyyyy - Chapter 2.ppt
SolomonSB
 
一比一原版(SUNY-Albany毕业证)纽约州立大学奥尔巴尼分校毕业证如何办理
Taqyea
 
Computer Securityyyyyyyy - Chapter 1.ppt
SolomonSB
 
introduction to networking with basics coverage
RamananMuthukrishnan
 
L1A Season 1 ENGLISH made by A hegy fixed
toszolder91
 
𝐁𝐔𝐊𝐓𝐈 𝐊𝐄𝐌𝐄𝐍𝐀𝐍𝐆𝐀𝐍 𝐊𝐈𝐏𝐄𝐑𝟒𝐃 𝐇𝐀𝐑𝐈 𝐈𝐍𝐈 𝟐𝟎𝟐𝟓
hokimamad0
 
一比一原版(LaTech毕业证)路易斯安那理工大学毕业证如何办理
Taqyea
 
introductio to computers by arthur janry
RamananMuthukrishnan
 
Agilent Optoelectronic Solutions for Mobile Application
andreashenniger2
 
ONLINE BIRTH CERTIFICATE APPLICATION SYSYTEM PPT.pptx
ShyamasreeDutta
 
法国巴黎第二大学本科毕业证{Paris 2学费发票Paris 2成绩单}办理方法
Taqyea
 
Build Fast, Scale Faster: Milvus vs. Zilliz Cloud for Production-Ready AI
Zilliz
 
Optimization_Techniques_ML_Presentation.pptx
farispalayi
 
sajflsajfljsdfljslfjslfsdfas;fdsfksadfjlsdflkjslgfs;lfjlsajfl;sajfasfd.pptx
theknightme
 
internet básico presentacion es una red global
70965857
 

Fewd week8 slides

  • 1. FEWD - WEEK 8 WILL MYERS Freelance Front End Developer SLIDES http://www.slideshare.net/wilkom/fewd-week8-slides
  • 2. FINAL PROJECT MILESTONE 3 By week 8, you should have submitted a draft of the JavaScript and jQuery you'll need for your final project. This week, focus iterating on your project to turn in an updated draft.
  • 3. YOUR WEEKLY FEWD GITHUB REPOSITORY Use the '+' button in the top-left of GitHub Desktop (Create tab) Create a new repository called 'FEWD_Week8' Choose the [home]/FEWD folder for the local path Open this repo folder in your editor Commit the changes and publish the FEWD_Week8 repository to github.com
  • 4. YOUR WEEKLY WORKING FILES FROM ME To get the week8_working_files you should just be able to select the ga-fewd-files repository in GitHub Desktop and press 'Sync'. This should pull in this weeks folder from github.com. If you any difficulties you should just re-clone the ga-fewd- files repository. Copy the whole week8_working_files into your FEWD_Week8 repository and commit and publish to github.com
  • 5. REVIEW OF LAST WEEK'S ASSIGNMENT See also http://learn.shayhowe.com/advanced-html- css/responsive-web-design/
  • 6. FORMS How we can get data from users?
  • 7. FORMS A wrapper for data collection elements Text fields Dropdowns Radio Buttons etc
  • 8. FORMS Tells the page: Where to send the data How to send it What is being sent
  • 10. FORM TAG Available Attributes Method: Get, Post, Put, Delete Action: Url to send data to Enctype: 'multipart/form-data' if uploading files
  • 11. FORM TAG In Action <form action="register.php" method="post" enctype="multipart/form-data" <!--Data collection elements go here--> </form>
  • 12. INPUTS Place between <form> </form>tags Attributes type: text, submit, password, email, checkbox, button, radio, file, number, search, etc name: used server side placeholder value https://developer.mozilla.org/en- US/docs/Web/HTML/Element/input
  • 13. INPUTS Gotchas The font-family for an input is not inherited!!! This can lead to funny sizing issues on Macs vs. PCs where the default font is not the same
  • 14. TEXT Use the valueattribute to set initial text Use the placeholderattribute to set placeholder text
  • 15. EMAIL Allows browser to autofill field
  • 17. SUBMIT VS FILE VS BUTTON valueis button text. Defaults to submit in chrome: <input type="submit" value="Submit"> Creates a file upload element <input type="file"> Creates clickable button <input type="button">
  • 19. SELECT AND OPTION The <select>tag is for dropdowns and contains <option>s. <select> <option value="option1">first</option> <option value="option2">second</option> <select> The valueattribute represents the value to be submitted with the form, should this option be selected. If this attribute is omitted, the value is taken from the text content of the option element. <option>first</option> <!-- value is "first" -->
  • 20. LABELS Information about the input field should be put in a <label>tag To tie the two together choose one of these methods: <label>Name <input type="text" name="yourName"></label> <label for="yourName">Name</label> <input type="text" name="yourName" id="yourName"> NB Usability: Clicking the label text in either case places the focus in the input field (great for radio buttons)
  • 21. FIELDSET/LEGEND <fieldset>is a wrapper for grouped form elements, e.g. 'first', 'middle', 'last' name text fields. <legend>goes inside fieldset and defines the grouping term for the fieldset <fieldset> <legend>Your Name</legend> <input type="text" name="first_name"> <input type="text" name="middle_name"> <input type="text" name="last_name"> </fieldset>
  • 22. STYLING Styling forms is tricky because form widgets were originally built to use the underlying operating system UI. CSS was added for styling other elements some years later. For a good summary on styling forms, read the following: https://developer.mozilla.org/en- US/docs/Web/Guide/HTML/Forms/Styling_HTML_forms
  • 23. STYLING The following forms elements are straightforward to style in the same way that you would style a <p>or a <div>or a <nav>: <form> <fieldset> <label> <output> all text field widgets e.g. (<input>or <textarea>) all buttons ('submit', 'reset', 'button')
  • 24. STYLING WORKAROUNDS The following form elements cannot be styled directly with CSS Checkboxes File upload inputs Radio buttons
  • 25. STYLING WORKAROUNDS There are a number of workarounds for styling 'bad' and 'ugly' form elements Opacity 0 on the element, set its height and width to define clickable area, set the height and width of its parent to be the same as the input (don't forget position relative). Style the parent. Hide the element, style a corresponding label how you wanted the element to appear
  • 26. STYLING WORKAROUNDS Try using pseudo elements and the selector :checked for 'no-JS' switching between checked and unchecked images used for styling Use JavaScript
  • 27. STYLING WORKAROUNDS Let's read the following article and then build a custom styled checkbox group using one of the techniques from the previous slide: https://developer.mozilla.org/en- US/docs/Web/Guide/HTML/Forms/Advanced_styling_for_HTML
  • 28. STYLING Let's have a look at a styled form with a styled <select> widget, using the following properties to override any default UI appearance: appearance:none; -webkit-appearance:none; -moz-appearance: none; Open week8_working_files/form_style
  • 29. STYLING Now complete the on the Mozilla web page. postcard form styling exercise
  • 30. VALIDATION Validation occurs on both the front end and the back end. The front-end can check for whether a field has been left blank and whether your password confirmation matches your password. Can you write some JavaScript to perform simple validation for one of the forms we have looked at?
  • 31. VALIDATION LIBRARIES Parsley.js is a third party JavaScript library that you can use for more rigorous front-end validation. It works with jQuery. http://parsleyjs.org/ http://parsleyjs.org/doc/index.html#psly-frontend-form- validation Open week8_working_files/form_style_validation
  • 32. TODO LIST EXERCISE Open week8_working_files/to_do_list