Add data from another table

Hello, I’m with radsystems 7.1.2 node + quasar + mysql, maybe my query is simple, but the problem is not adding data from one table to another… But when I’m in a certain field of my form, that’s when I need check if the number added by the user already exists in another table.
If it exists, throw a popup that if you want to add it or not… choose yes, bring the data from the other table but place it in readonly, and if the record that the user added in the field does not exist, a popup that says that doesn’t exist and allows you to add the data…
Any example of how to achieve this?
Greetings to the community and thanks for the help always!