A client asked me to enter an invoice you can select the identity card of the provider, and depending on it fill a field with the same name, and if you are not registered, you can register.
Then I implemented Select2 for the ID search, and created a input
field to be automatically filled in when selecting the provider's ID. In case the provider does not exist, I implemented a modal that will contain a form to register a new provider. All this mounted on Laravel 5.4.
My doubts arise next;
1.- How can I get the input filled with the name of the provider based on the DNI selected in Select2?
2.- In case the provider is not registered in the system How can I display the modal to register the provider automatically?
The DNI and the names are logically in the same table of the BD.