I am using jQuery Form to submit an Ajax form to a MySQL database. One of the form fields is a dropdown menu which contains available dates that the user must select from. This data corresponds to a specific column ("metrics_date") in the table. The user also selects their appropriate site location ("location"), which is also stored in the table.
I would like to do a bit of pre-processing and query the database to see if a row already exists in the table with that same date for that site location. If it does exist, the user should be notified of the duplicate entry and form processing should stop. If it does not exist, form processing should continue.
For example -- A user selects 2011-02-16 as their metrics_date and "Site 1" as their location. The user does not realize that their team member already updated their data for this date, so a record for Site 1 with a metrics_date of 2011-02-16 already exists. They should be alerted to this, and the form should not be submitted.
I used this tutorial to create my jquery / ajax form --
Any advice or suggestions are welcomed. Thanks in advance.