-2
Good afternoon, everyone,
I created an input field to receive email and my only requirement is to ensure that you have a "@" and at least a ".". I read several REGEX to do this validation, but all are too complex and I have very short email addresses on the internal server here in the company, so most of the REGEX ready do not serve me.
Follow my form
<b>E-mail: </b><input name="email" type="text" id="email" value="" size="30" Onkeyup="valida()" required />
Follow my javascript so far:
function valida(){
var email = document.getElementById("email").value;
email = /^[\w!#$%&'*+\/=?^`{|}~-]+(\.[\w!#$%&'*+\/=?^`{|}~-]+)*@(([\w-]+\.)+[A-Za-z]{2,6}|\[\d{1,3}(\.\d{1,3}){3}\])$/.toLowerCase();
document.getElementById("email").value = email;
}
Grateful for the collaboration
Because it just doesn’t
type="email"
in that input??– hugocsl
@hugocsl, legacy server with HTML 4
– Anderson Fidelis