Fixed XSS vulnerability by sanitizing fields when adding via Javascript