This topic is locked

Trim User Form Field Data

4/26/2011 6:08:38 PM
ASPRunnerPro General questions
T
tone21705 author

Hi,
Searched the forms but couldnt find anything exactly about this.
On my add page of my ASPRunner project. Users are entering data (e.g. "Joe ") and in the db it is getting saved with the extra spaces on the end.
If I goto the Edit page after, the spaces are still there.
Does ASPRunner already trim? If not how would I go about enabling that?
Thanks,

Antoni

Sergey Kornilov admin 4/27/2011

ASPRunnerPro doesn't trim data. You may want to use something like this in BeforeAdd event:

values("FieldName")=RTrim(values("FieldName"))


More info:

http://www.w3schools.com/vbScript/func_rtrim.asp
Just in case make sure you are not using CHAR datatype in SQL Server as field value will be padded by spaces to fit the field size in the database.