Converts email addresses in your Text Area to email tags after validation.
Web visitors can either type in the emails or paste a large list. You can configure delimiters (, ; \n) for separating emails.
###[Demo] (http://jsfiddle.net/vpfaiz/pD49Q/)
HTML/Javascript/CSS is not my primary field. This is something that I created as part of a project. Thought of sharing it with you.. Will be willing to learn from you Gurus out there but please do not expect high quality stuff here. I have done some fair testing on this but use it on your own risk... :)
emailArea($("#textAreaID"), [',',';',' ']);
- First parameter is the JQuery object for TextArea element that you want to convert to EmailArea
- Second optional parameter is the array of separators that you want to use to separate email addresses as you type in. The default set is
[',',';','\r','\n',' ']
.
- Your TextArea will be hidden and replaced by EmailArea control in UI but the good emails list (CSV) will be set on your TextArea itself. The EmailArea control will also copy styles from your TextArea item (most of them).
- It uses a code (function isValidEmail) from SO user aSeptik (http://stackoverflow.com/a/2855946/82961) for email validation. You may want to change this with your own function (even change it to validate something other than email)