Exercise 11
- Create a new folder with the name
ex_11
- Create the following file structure
/ex_11
|-- index.html
|-- login.html
index.html
- Add a Document Title: Login
- Add a Main Title: Login
- Add an Horizontal Rule
- Create a form element with the following attributes:
- action: login.html
- method: get
- enctype: 'application/x-www-form-urlencoded'
- Inside the form create the following inputs:
- Create a text input with the following attributes: name: username placeholder: username size: 30 maxlength: 12
- Create a password input with the following attributes:
- name: password
- size: 30
- maxlength: 8
- placeholder: password
- Create a submit button:
- value: Login
- name: login
login.html
Add a Document Title: Look at the URL
Add a Main Title: Look at the URL
Add an Horizontal Rule
Add a paragraph with the following text: We created our first form!!
Go to index.html
Input a username and password
Submit the form by clicking on the submit button
The browser will navigate to the login.html page
Take a look at the URL to see the data that you just input on the previous form
Now change the form method to be
post
instead ofget
and go over the last steps to input data, execute the form and look at the URL again to see the difference between these two methods :)