Trimming String Fields?
Posted: 09 Mar 2014 23:30
Howdy!
I tried implementing an OnAsyncExit event to implement trimming of the field text, but it has negative side effects on my pages (i.e. caused some regions to not draw right after my first control exits).
So my question is how can I implement a simple ajax routine to strip any blanks on an edit field after the users tabs out?
My OnAsyncExit routine was written as follows:
void __fastcall TIWAppFormActionsDataModule::OnDBEditAsyncExit(TObject *Sender, TStringList *EventParams)
{
TIWEdit * pEdit = dynamic_cast<TIWEdit *> (Sender);
if (pEdit == NULL)
{
return;
}
pEdit->Text = pEdit->Text.Trim();
}
Thanks in advance,
Aggie85
I tried implementing an OnAsyncExit event to implement trimming of the field text, but it has negative side effects on my pages (i.e. caused some regions to not draw right after my first control exits).
So my question is how can I implement a simple ajax routine to strip any blanks on an edit field after the users tabs out?
My OnAsyncExit routine was written as follows:
void __fastcall TIWAppFormActionsDataModule::OnDBEditAsyncExit(TObject *Sender, TStringList *EventParams)
{
TIWEdit * pEdit = dynamic_cast<TIWEdit *> (Sender);
if (pEdit == NULL)
{
return;
}
pEdit->Text = pEdit->Text.Trim();
}
Thanks in advance,
Aggie85