Thursday, March 16, 2017

Lab 13- JavaScript Forms and Alert Boxes

     After creating our first ever javascript, we had to further improve that lab. In lab 13, we had to make sure our form functions well. The form we created in the past lab was still used in this lab except we changed the forms name to alert form. In order to make the function work we had to use the input tag and within the input tag we had to add the type and value. This input tag allowed the user to create a button that says go to work when it gets clicked on. However, we are not done yet. Afterwards we must add an onclick which met equal="window.alert(_____);"> Inside of the parenthesis the user is allowed to add words that will be shown in a window when a person clicks on the go button you created earlier with the tag input. The user must keep in mind that when you write inside the parenthesis, the words you want to appear in the window should be surrounded with single quotation marks and must be followed by a plus sign and the phrase "document.alertform.yourname.value". You must add this into the parenthesis because it will allow the document to understand that when the user types in a value in the form the will be able to get a response from the computer due to the arms input name. If done correctly, in the website if a person fills in the form and press the button go, they will be able to see a window pop up with the information they gave.
   This lab was difficult compared to the previous lab because unlike the previous lab, in this lab we had to make sure the form works when someone fills in their information. At first I found it very difficult to make the words pop up in the window. However, I realized that I did not out single quotation marks around the words I wanted to appear on behalf of the window. However, just as the previous lab, my favorite part of this lab was being able to style the website using css. After finishing this lab I was excited because I was able to make a form work and that was something i never expected to do, so it felt like a great accomplishment.


No comments:

Post a Comment