I have added following affiliate email field (custom attribute) to the customer registration form. Now I want to validate that if value already exists in the database table.
<div class="control">
<input type="text" name="affiliate_email" id="affiliate_email" value="<?= $block->escapeHtml($block->getFormData()->getCustomField()) ?>" title="<?= __('CustomField') ?>" class="input-text" data-mage-init='{"validation":{}}'>
</div>
What is the best way to do this ?