Created
April 25, 2018 14:55
-
-
Save hchouhan/769c8ebc9bb07dd6572a8b4c60e2684b to your computer and use it in GitHub Desktop.
Block free mail
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<input type="email" name="email" required placeholder="Enter Email" | |
oninvalid="this.setCustomValidity('Free email providers are not allowed')" | |
oninput="this.setCustomValidity('')" | |
pattern="^(?!.*@(?:hotmail|gmail|ymail|googlemail|live|gmx|yahoo|outlook|msn|icloud|facebook|aol|zoho|mail|yandex|hushmail|lycox|lycosmail|inbox|myway|aim|fastmail|goowy|juno|shortmail|atmail|protonmail)\.\w+$).*$" | |
/> | |
/** | |
lap [7:38 PM] | |
if you use oninvalid= do not forget the oninput="this.setCustomValidity('')" | |
else the message is stuck there | |
**/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment