I need help for my register form. I'm registering users with their website link, email and password. I need some jQuery script to disallow users to change the prefix of their email. So for example they putted https://google.com for their website => which automatically allow only @google.com email to be written down below in the email input. One more example:
Website: https://youtube.com
Allowed Email: john@youtube.com
Disallowed Email: john@outlook.com
I tried with:
<script>
$("#email").on('keyup input change', function() {
var val = $(this).val();
if(val.indexOf("@outlook.com") != 1) {
$(this).val(val + '@outlook.com');
}
});
</script>
but that's absolutely not what I expect. Besides everything, I need to figure out a way to get only the domain from the link..
Any ideas?
Thanks in advance!