I am using xajax with my php form which saves data to mysql table.
Now i have it like this:
input where user gives his name,
dropdown1 where user picks a car manufacturers,
dropdown2 is inside of a div where xajax function is used to create and fill the dropdown2 with car models,
submit button
When user clicks the submit button i also have some javascript to validate the form and in my function where posted values are saved in database i also check the values with php.
Would it be better that when user clicks the submit button i have a xajax function that validate the form and then saves the data to mysql table?
Any advice how ajax is used in php foms correctly?