Question: Add JavaScript code to the tag. Use the onsubmit event handler to call the function that creates the cookie. Create code that informs the user

Add JavaScript code to the

tag. Use the onsubmit event handler to call the function that creates the cookie. Create code that informs the user if the name field is left blank. If the name field has a value, pass the user's name in the call. In both the if clause and the else clause, use a return false statemet to negate the submission of the form. The setting of the cookie is all that should occur for the submit event.

Add another button to the HTML form. Use an onclick event handler with this scriptable button to open a new window. Write code that will display the user's name (extracted from the cookie) in a welcome message in the document of the new window.

"POST" action="success.html" onsubmit="return saveCookie();">

Username

"text" name="username" id="username">

-----------------------------success.html---------------------

Cookie Created

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!