Email Parser

[Total: 0    Average: 0/5]

This shows how to have javascript parse data to find email addresses.

Body Code:

<!-- Begin 
function findEmailAddresses(StrObj) { 
var separateEmailsBy = ", "; 
var email = "<none>"; // if no match, use this 
var emailsArray = StrObj.match(/([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+.[a-zA-Z0-9._-]+)/gi); 
if (emailsArray) { 
email = ""; 
for (var i = 0; i < emailsArray.length; i++) { 
if (i != 0) email += separateEmailsBy; 
email += emailsArray[i]; 
return email; 
//  End --> 
Enter into the text area some email addresses - when you click outside of the textarea
any email addresses entered will be put into the text box below (delinated by commas)
<textarea name=comments rows=10 cols=50 onBlur=";"></textarea> 
Email:  <input type=text name=email> 

Times Viewed: 4

Leave a Reply

Your email address will not be published. Required fields are marked *