Completed
Last Updated: 20 Jul 2016 14:08 by ADMIN
Mark
Created on: 17 Jul 2013 08:08
Category: InputManager
Type: Feature Request
1
RadTextBox: Automatically trim leading & trailing whitespace from user input
The RadTextBox (and other input controls as appropriate) should have an aspx property to automatically trim leading & trailing whitespace from user input. This will help ensure that good quality data is passed to the database.

The only way this can currently be done is to custom code "mytextbox.Text.Trim();" for every control on the page, before the property is sent to the database.
1 comment
ADMIN
Vasil
Posted on: 17 Oct 2013 12:38
You could achieve this globally for all your inputs by simply overriding the 
Telerik.Web.UI.RadInputControl.prototype.raise_valueChanging function to something like:
Telerik.Web.UI.RadInputControl.prototype.raise_valueChanging = function(args)
{
    //use the args here to trim the value, and then call the raiseEvent to be sure that no other functionality is broken.
    this.raiseEvent("valueChanging", args);
}

You could do this by server approach as well by using a ControlAdapter.