Concept explainers
a)
To create a function named calcCart ()to calculate the registration cost and save the customer’s choices information in the session storage and to store the value of the customer first and last name fields of the regForm forma variable named confNamein the session storage variable confName in the mas_register.jsfile.
b)
To create the four variablesin the session storage named confGroupto store the value of the group,confMailto store the value of the email, confPhoneto store the value of the phone, and confBanquetto store the value of the banquetGuests in the mas_register.jsfile.
c)
To create a session storage variable named confBanquetCostto store the cost of the banquet. Calculate the cost of the banquet by multiplying the banquestGuests field value by the value of 55 in the mas_register.jsfile.
d)
To record the user selected session when the selected session is not equal to -1 then store the selected option text in the session storage variable named confSessionand store the selected optionvalue in the session storage variable named confSessionCost. When the selected session equals to -1 then set the selected option text to empty and set the selected option value to 0 in the mas_register.jsfile.
e)
Tocreate two session storage variable named confPackand confPackCost when the user clicked the mediaCB check box and set the value “yes” in the confPackvariable and set the cost of media pack 115 in the confPackCost variable. Otherwise set the values “no” and 0 in the confPackandconfPackCost variables in the mas_register.jsfile.
f)
Tocreate a session storage variable named confTotalto calculate the total registration cost by adding the value of session storage variables named session (confSessionCost) + banquet (confBanquetCost) + media (confPackCost) . The parseFloat ()method return the numeric values of the data fields in the mas_register.jsfile.
g)
To call the writeSessionValues ()function in the mas_register.jsfile.
Want to see the full answer?
Check out a sample textbook solutionChapter 13 Solutions
EBK NEW PERSPECTIVES ON HTML5, CSS3, AN
- New Perspectives on HTML5, CSS3, and JavaScriptComputer ScienceISBN:9781305503922Author:Patrick M. CareyPublisher:Cengage Learning