Skip to content

Instantly share code, notes, and snippets.

@Tomasz-Silpion
Created August 20, 2016 01:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Tomasz-Silpion/4f0c8bbab85127554cddc199b3f25ef9 to your computer and use it in GitHub Desktop.
Save Tomasz-Silpion/4f0c8bbab85127554cddc199b3f25ef9 to your computer and use it in GitHub Desktop.
Prototype.js Magento value trim (replace spaces) on email validation
$$('.validate-email').each(function(input){
input.observe('change', function(e){
this.value = this.value.replace(/^\s+|\s+$/g,"");
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment