I am working on a project that already existed when I arrived at the company.
Users need to paste several ISBN numbers from Excel to a search field in my Index page (HTML). They do so by selecting many ISBNs from Excel and copy/paste into the search field. The problem is that sometimes ISBNs are poorly formatted and may have a letter or special symbol in the middle (don’t ask me why, no idea).
The string resembles to something like this:
3356565663541 3356565663541 3356565663541 3356B565663541 3356565663541A
The code in my index page for the input form is:
<div class="col-lg-4">
<div class="form-group">
<label>ISBN</label>
<input asp-for="Advanced_ISBN" id="ISBN" type="text" placeholder="" class="form-control">
</div>
</div>
I need a way to analyze what is pasted into the text box and signal to the user that something is wrong.
I'd like to do that in C# if possible but I have no idea on how to:
Detect the "paste into the textbox" with the ctr-v or right click, past;
Get the string to analyze it;
Show it on a new temporary window with highlighted color on the line that may contain an error.
Users would press OK if everything is correct or detect the line that is NOK.