Hello All,

I have a form where I ask my users for a comma seperated web site list.
I want to make sure this list only contains the host names of URLs without any white spaces

Original list: site1.com, http://site2.com, http://www.site3.com,sub.site4.com
Edited list: site1.com,site2.com,site3.com,sub.site4.com

Currently I have the following to get the comma separated list

Code:
var list = document.getElementById( "list" ).value ;
Can some one please help me with above task of getting host names and trimming for white spaces?
I am very new to JavaScript language and highly appreciate your help or direction.