Simple JavaScript & jQuery
$(document).on(“blur”,”:input”,function() {
this.value = this.value.trim();
});
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Using asp.net 4.7 C# mvc
Have a typical CRUD application, sometimes the user may input whitespace into a textbox.
one solution is to write javascript to manage each of the textboxes and remove whitespace to accomplish what textboxitem.trim(); does?
Is there a newer or better way to remove user white space at POST time?
thanks
Simple JavaScript & jQuery
$(document).on(“blur”,”:input”,function() {
this.value = this.value.trim();
});