I want to validate email address on text field i.e. <input type='text'/>
fields. I know in html5 there is a separate field for email
i.e <input type='email'/>
. But due to some reasons I can't / don't want to use that tag. Also in HTML 5 there there is default validation messages. But I am using some thing like below to show custom validation messages:
oninvalid='this.setCustomValidity("please enter your first name")' oninput='setCustomValidity("")'
this code is working fine for my required
text fields. I want to validate my email address in same way with custom messages like: you have not included @ sign or you have not included domain name etc. How can I do this with similar pattern for showing email validation with custom HTML 5 messages.