"I want to validate HTML fields using JavaScript and display error messages beside the respective fields. Also it should display a consolidated error message on the top of the form, something like ""Please enter the required fields"". How can I do this?"