Is there any way to match the html one field data with the Google sheet column. And check the second column after that and then enter the data

I have a google sheet, and I want to get HTML form data in that google sheet. The google sheet has 4 columns.

  1. Voucher Code
  2. Name
  3. Email
  4. Phone number

Voucher code column is already filled with voucher codes.

And in the HTML form, person will fill the voucher code, name, email and Phone number. Voucher code will match the voucher code column and data of name, email and phone number will be filled in the same row. Now here I have to check the validation. If the voucher code, already has name, email and phone number. Then there should give a error message that already someone is there on that voucher code. And if the name, email and phone number column is empty for any voucher code. Then only the html form data should go.

Please help me regarding this.

Thank you