Remove (Trim) Leading and Trailing Spaces in User Log In Form - xmpie-users/uStore-js GitHub Wiki

Sometimes you know that you have users that log in by copying the credentials from some source, and that source may contain leading or trailing spaces (before or after the email address).

This JavaScript simply trims the log in user field, and removes these spaces.

It does not validate the input in any way.

<script> 
$(document).ready 
( 
function() { 
$("#ctl00_cphMainContent_btnLogin").on("click", function(){ $("#ctl00_cphMainContent_txtEmail").val($.trim($("#ctl00_cphMainContent_txtEmail").val()));}); 
} 
); 
</script>

For information on how to add JavaScript to your store: How to add JavaScript to a storefront.

⚠️ **GitHub.com Fallback** ⚠️