You are tasked with writing client-side and server-side code to validate and process form data. The HTML form has the following structure:
Part A. JavaScript / jQuery
Write JavaScript / jQuery code to validate the form data before submission to the server. You must ensure each field adheres to the following criteria:
If all validation criteria is met, the form data must be sent to the server using an AJAX POST request. Output an appropriate console message if the AJAX request fails. [8 marks]
Part B. PHP
Write PHP code to receive, process, and respond to the request made from the JavaScript / jQuery code you wrote for Part A. Validation of the data should be performed, using the same criteria as Part A. If validation is passed, write the data to a text file. Correct HTTP responses must be given. [8 marks]
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here