FCC Challenge 29: Create a Form Element
March 12, 2016
In Free Code Camp Challenge 29 we’re submitting a form to the server.
You can build web forms that actually submit data to a server using nothing more than pure HTML. You can do this by specifying an action on your form element.
For example:
[html]
[/html]
Nest your text field in a form element. Add the action=”/submit-cat-photo” attribute to this form element.
The original code is below:
[html]
CatPhotoApp
Click here for cat photos.
Things cats love:
- cat nip
- laser pointers
- lasagna
Top 3 things cats hate:
- flea treatment
- thunder
- other cats
The updated code with form submission is below:
[html highlight=”46-48″]
CatPhotoApp
Click here for cat photos.
Things cats love:
- cat nip
- laser pointers
- lasagna
Top 3 things cats hate:
- flea treatment
- thunder
- other cats