Form API Categories list

Drupal 7: How to execute custom javascript before submiting an #AJAX Form

I had a Drupal project where I need to submit a form without reloading the page so I used Form API #ajax parameter to execute my custom callback function and validate the form.

Sample FORM: