
Sequence:
If the user enters a data into the "code" field, and when he press save, the script will check if that code inserted by the user is already existing in the column name "code" in the database.
If there is an existing entry in the code column, a message will pop-up saying "Code already exist." And if the inputted data of the user doesn't exist in the database, he/she will be able to save it.
As an example:
1. User enters 1211 in the code field and press save. (as to what you can see in the image, the code 1211 which has a description of chess already exists in the database. So a message will be dislayed saying "Code already exist".)
2. And if the user enters the code 7777 which doesn't exist yet in the database. There will be a message saying, "No match found. Please save your item."