Question: (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
i Here is a JavaScript function called validate that performs the validation described function vali... View full answer
Get step-by-step solutions from verified subject matter experts
