(b) The following HTML form allows a user to supply details for purchase of tickets for...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
(b) The following HTML form allows a user to supply details for purchase of tickets for a concert. (Some of the options from the select element have been omitted). When the submit button is clicked a JavaScript function called validate is invoked to check that the name fields contain data, the card number satisfies a CRC check and that the number of tickets is an integer in the range 1 to 10. <form action = "page2.jsp" method="post" name= "form1" onsubmit = "validate()"> <table> <tr> <td> Name </td> <td> <input id= "n" name = "name"> </td> </tr> <tr> <td> Card number </td> <td> <input id = "c" name = "card"> </td> </tr> <tr> <td> Performance </td> <td> <select id = "p" name= "perf"> <option value = "1" selected> 2.30pm Aug 17 </option> <option value = "2"> 7.30pm Aug 17 </option> </select> </td> </tr> <tr> <td> Number of tickets </td> <td> <input id = "t" name = "tickets"> </td> </tr> </table> <input type= "submit" value = "Book tickets" /> </form> (i) Write a JavaScript function called validate that will perform the validation described above; it should display an appropriate alert if any input is invalid. You may assume a function to do the CRC check has already been written. (ii) Explain why it is desirable to perform both client-side and server-side validation of form data such as in the example above. (b) The following HTML form allows a user to supply details for purchase of tickets for a concert. (Some of the options from the select element have been omitted). When the submit button is clicked a JavaScript function called validate is invoked to check that the name fields contain data, the card number satisfies a CRC check and that the number of tickets is an integer in the range 1 to 10. <form action = "page2.jsp" method="post" name= "form1" onsubmit = "validate()"> <table> <tr> <td> Name </td> <td> <input id= "n" name = "name"> </td> </tr> <tr> <td> Card number </td> <td> <input id = "c" name = "card"> </td> </tr> <tr> <td> Performance </td> <td> <select id = "p" name= "perf"> <option value = "1" selected> 2.30pm Aug 17 </option> <option value = "2"> 7.30pm Aug 17 </option> </select> </td> </tr> <tr> <td> Number of tickets </td> <td> <input id = "t" name = "tickets"> </td> </tr> </table> <input type= "submit" value = "Book tickets" /> </form> (i) Write a JavaScript function called validate that will perform the validation described above; it should display an appropriate alert if any input is invalid. You may assume a function to do the CRC check has already been written. (ii) Explain why it is desirable to perform both client-side and server-side validation of form data such as in the example above.
Expert Answer:
Answer rating: 100% (QA)
i Here is a JavaScript function called validate that performs the validation described function vali... View the full answer
Related Book For
Systems analysis and design
ISBN: 978-0136089162
8th Edition
Authors: kenneth e. kendall, julie e. kendall
Posted Date:
Students also viewed these programming questions
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
The pseudocode below has been written as an algorithmic solution to the following programming task but is not complete and may include some incorrect logic. the pseudocode to incorporate all aspects...
-
Explain why the coffee shop manager should measure elasticity using the mid-point method in his calculations.
-
What is Metabolic Syndrome in Mental Health and Addiction Treatment and conduct a Quantitative research
-
The following information was drawn from the accounting records of Earles Company as of December 31, 2016, before the temporary accounts had been closed. The Cash balance was $6,000, and Notes...
-
An investigator is considering two blocking schemes for a $2^{4}$ design with 4 blocks. The two schemes are listed below. Scheme 1: $B_{1}=134, B_{2}=234$ Scheme 2: $B_{1}=12, B_{2}=13, B_{3}=1234$...
-
On July 1, 2014, Witherspoon Satellites issued $4,500,000, 9%, 10-year bonds at $4,219,600. This price resulted in an effective-interest rate of 10% on the bonds. Wither-spoon uses the...
-
Carbata Company manufactures low-cost, basic tool kits in bulk. Below is the latest information for last month's production. Inventory on September 1 96 Complete Units Started Costs Added in...
-
Goldman Sachs SEC filing for the quarter ended March 31, 2019, report contains the following lease footnote. Leases (ASC 842). In February 2016, the FASB issued ASU No. 2016-02, Leases (Topic 842)....
-
Effect of a Start-Up Delay on Profitability: I just noticed a new restaurant in the shopping center near my home. The restaurant appears ready to open, but because of the COVID-19 epidemic, the...
-
The \(12 \mathrm{~V}\) rating of the bulb refers to the rms voltage. What is the peak voltage across the bulb? A. \(8.5 \mathrm{~V}\) B. \(12 \mathrm{~V}\) C. \(17 \mathrm{~V}\) D. \(24 \mathrm{~V}\)...
-
How much current is drawn by the lamp at the outlet? That is, what is the rms current in the primary? A. \(0.42 \mathrm{~A}\) B. \(1.3 \mathrm{~A}\) C. \(4.2 \mathrm{~A}\) D. \(13 \mathrm{~A}\)...
-
a. The three bulbs in Figure Q23.16 are identical. Rank the bulbs from brightest to dimmest. Explain. b. Suppose a wire is connected between points 1 and 2 . What happens to each bulb? Does it get...
-
For the circuit of Figure P26.60, a. What is the resonance frequency? b. At resonance, what is the peak current through the circuit? FIGURE P26.60 (10 V) cos (2ft) i eeee-ww 1002 1.0 mH 1.0 F
-
Figure P26.2 shows voltage and current graphs for a resistor. a. What is the value of the resistance \(R\) ? b. What is the emf frequency \(f\) ? FIGURE P26.2 VR 10 V- Voltage Current 0.50 A 0+ 0.00...
-
Import tariffs and quotas, nontariff barriers, export subsidies, and local content requirements are all examples of which kind of industry globalization driver?r cost forcesr competitive forcesr...
-
(a) Prove that form an orthonormal basis for R3 for the usual dot product. (b) Find the coordinates of v = (1, 1, 1)T relative to this basis. (c) Verify formula (5.5) in this particular case. 48-65...
-
Create a series of CRC cards for Worlds Trend Catalog Division. Once an order is placed, the order fulfillment crew takes over and checks for availability, fills the order, and calculates the total...
-
Assume your group will serve as a systems analysis and design team for a project designed to computerize or enhance the computerization of all business aspects of a 15-year-old, national U.S....
-
As a general guideline, when should present value analysis be used?
-
True or False: Annual worth analysis is the most popular DCF measure of economic worth.
-
Consider a palletizer at a bottling plant that has a first cost of \($150,000,\) operating and maintenance costs of \($17,500\) per year, and an estimated net salvage value of \($25,000\) at the end...
-
True or False: Unless non-monetary considerations dictate otherwise, choose the mutually exclusive investment alternative that has the greatest annual worth over the planning horizon.
Study smarter with the SolutionInn App