Answered step by step
Verified Expert Solution
Question
1 Approved Answer
(b) The following HTML form allows a user to supply details for purchase of tickets for a concert. (Some of the options from the
(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. Name Card number Performance 2.30pm Aug 17 7.30pm Aug 17 Number of tickets (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.
Step by Step Solution
★★★★★
3.48 Rating (164 Votes )
There are 3 Steps involved in it
Step: 1
i Here is a JavaScript function called validate that performs the validation described function vali...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started