I need to deploy one of ML models as a web application. I am working to use HTML to get the input data and pass it to ML model for a live prediction. One of the inputs for this ML model is a 5 digit code. The code should be one of the predefined codes like one in this list [19827, 87198, 18288, ....], which contains 1000 unique values. The user should enter such a code. I want to tell the user whether the input code is valid or not. I am using the following line:

```
<input type="number" name="code" placeholder="code" min="10000" max="99999" step="1" pattern="\d+"/><br>

```

but this does not limit the input to the above list. For example, if user enter a code like 22222 and if that is not in the list the web app should tell the user that this is not valid. How can I do this one in a very efficient and professional way?