Hi to all.
I didnt work much with JS so please be patient :-).
I want to make some email validation that will check for standard email format.
Basically, i need to make one registration page where i have to check email, empty fields etc.
Am planing to mix js with css to get some nice effect.
The idea is to highlight the inline border of textfield after js detects wrong or no entry…
when the user starts to write text in second field or when he presses submit.
I would use this approach on all fields.
[CODE]
function testMail(userMail) {
var mailMask = /^(?:[w!#$%&’*+-/=?^`{|}~]+.)*[w!#$%&’*+-/=?^`{|}~]+@(?:(?:(?:[a-zA-Z0-9](?:[a-zA-Z0-9-](?!.)){0,61}[a-zA-Z0-9]?.)+[a-zA-Z0-9](?:[a-zA-Z0-9-](?!$)){0,61}[a-zA-Z0-9]?)|(?:[(?:(?:[01]?d{1,2}|2[0-4]d|25[0-5]).){3}(?:[01]?d{1,2}|2[0-4]d|25[0-5])]))$/;
if(!userMail.match(mailMask)) {
/* RUN CODE FOR INLINE BORDER HIGHTLIGHT */
return false;
}
return true;
}
Any idea how to create and add this css part into JS code ?
Mark