For assignment four, you will be adding JavaScript to your forms. Use of bootstrap and jQuery is NOT ALLOWED. For this assignment we will focus on adding JS to add some functionality to our forms. We will also avoid using certain things in HTML and CSS and instead elect to implement them in JavaScript. The solutions you will write will be pure JavaScript. The purpose of this is to learn and get comfortable with JavaScript. The forms that will be adding JavaScript to are login.html, registration.html, and postimage.html. PLEASE NOTE, YOU ARE FORBIDDEN TO USE ANY JAVASCRIPT LIBRARY OR HTML5 Tag Attributes THAT DO INPUT VALIDATION UNLESS STATED OTHERWISE.
For you HTML forms to know what JavaScript code you will be calling, we need to link our JavaScript files to our HTML files. You may link your JavaScript files to your HTML pages by adding the following to the head tag of each HTML page:
< script type="text/javascript" src="path/to/file.js">< /script>
The type attribute will define the MIME type of the file which tells the browser this is a JavaScript file. The src attribute specifies the URL of an external script file.
If you need your JavaScript file to load AFTER the HTML is loaded, you may add the defer attribute to the HTML tag. This will cause the file to load after the html is parsed
Students are required to add JavaScript to their forms per the specifications below:
ALL forms should be in < form> tags. If your form is built using < table> tags this needs to be removed.
Note that normally when using the form HTML attribute action and URL, data from the form is automatically grabbed and transmitted to the server. But since we do not have a server to work with, we can have it trigger a JavaScript function and grab the data manually as an exercise. We can do this with the onsubmit attribute for the form and leaving the action attribute empty.
FORM VALIDATION DONE VIA HTML5 IS NOT ALLOWED, LATER WE CAN ADD THEM IN TO SIMPLIFY THE VALIDATION.
Students are required to add JavaScript to their forms per the specifications below:
login.html
registration.html - for guests to register accounts
postimage.html - for registered users to post images
When implementing the above requirements think about what happens when these requirements are not met. Some of these requirements can be verified as the user types, some can be verified when the user clicks the submit button. These design choices I leave up to you.