I'm new to wordpress and hence facing some issues: The use case scenario is as follows: 1) A user is displayed an application form to start a club in his school. 2) The user fills the form and hits the 'Submit' button. 3) The form needs to be validated. 4) If the validation is successful, then data is stored in custom table 'club_details' in db and the user is shown some message(eg: Thanks for submission. Your application is sent to the admin for approval.) else appropriate error messages are shown to the user. 5) The admin goes to the Wordpress admin panel to approve the pending requests for the club. (The data is fetched from db and shown to the admin).
Now, I have done the following: for 1) I have created a application form/page using the Wordpress HTML editor. for 3) I have a javascript file (validation.js) that has the validation code. for 4) I have a php file (club-functions.php) that has a function storeInDB() to store the application details in custom table in db. for 5) I have created my own plugin folder and added a php file (club.php) that displays the application details to the admin on the Wordpress admin panel.
I'm stuck up at the following place: How to handle the form submission. Where should I place the code that calls the javascript's validate function and later calls the storeInDB() function.
Please provide me some suggestions on how do I achieve this and is this approach good? Thanks a lot in advance.