Reputation: 879
I am having issues with using $.trim() in IE it works just fine in firefox. Does anyone see any reason this would fail. Thank you.
$('#GuestEmailAddress').on('blur', function () {
var $inputValue = $(this).val();
$.trim($inputValue);
$(this).val($inputValue);
});
Upvotes: 0
Views: 551
Reputation: 5122
Try changing the line ...
$.trim($inputValue);
... to ...
$inputValue = $.trim($inputValue);
The first does not change the $inputValue
, it simply returns the new string which in the second set of code I am assigning to a value that can then be used later in the code.
Upvotes: 1
Reputation: 568
Change your code as follows...
delete:
$.trim($inputValue);
change:
var $inputValue = $(this).val();
to:
var $inputValue = $(this).val().trim();
Upvotes: 1