Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » Elevate Web Builder Technical Support » Support Forums » Elevate Web Builder General » View Thread |
Messages 1 to 4 of 4 total |
Simple TEdit show/validate input? |
Fri, Sep 13 2013 9:43 PM | Permanent Link |
Ralf Bertoldi | How can I validate/show the input of an TEdit?
Is there any display or edit mask? I need to edit/show integer and currency values. There is no database attached. For example just 2x TEdit's , one for integer (0-9), one for currency (0.00). How can I avoid false input? What would be the best way to show the values if there would be a display mask? TIA ralf |
Fri, Sep 13 2013 11:42 PM | Permanent Link |
Raul Team Elevate | Ralf,
Haven't had to use it myself but one idea is to handle this in the OnKeyPress or OnKeyDown event. Something like this in OnKeyPress: if Key >= '0' and Key <= '9' then result := true else result := false; you can obviously check for length and such as well if you want to allow only certain length numbers. Currency is bit trickier as you'd likely want to allow only one "." and only after numbers and otherwise just numbers but quite doable. For masking you might have to do something like use "_.__" mask and then handle keydown or keypress, return false and actually update the edit control value in code (replacing the _ with the value) though this becomes bit more pain to manage. Raul On 9/13/2013 9:43 PM, Ralf Bertoldi wrote: > How can I validate/show the input of an TEdit? > > Is there any display or edit mask? > > I need to edit/show integer and currency values. There is no database > attached. > > For example just 2x TEdit's , one for integer (0-9), one for currency (0.00). > > How can I avoid false input? > What would be the best way to show the values if there would be a display mask? > > TIA > > ralf > |
Sun, Sep 15 2013 6:45 PM | Permanent Link |
Ralf Bertoldi | Raul,
Many thanks for your answer.! I was not sure if there are any functions/properties for that. I'll try to solve that in a native way; manual lacks on this. .. at the moment I'm trying to find all the workarounds for the js bugs in EWB.. .. really hard work.. thanks, Ralf Raul wrote: Ralf, Haven't had to use it myself but one idea is to handle this in the OnKeyPress or OnKeyDown event. Something like this in OnKeyPress: if Key >= '0' and Key <= '9' then result := true else result := false; you can obviously check for length and such as well if you want to allow only certain length numbers. Currency is bit trickier as you'd likely want to allow only one "." and only after numbers and otherwise just numbers but quite doable. For masking you might have to do something like use "_.__" mask and then handle keydown or keypress, return false and actually update the edit control value in code (replacing the _ with the value) though this becomes bit more pain to manage. Raul On 9/13/2013 9:43 PM, Ralf Bertoldi wrote: > How can I validate/show the input of an TEdit? > > Is there any display or edit mask? > > I need to edit/show integer and currency values. There is no database > attached. > > For example just 2x TEdit's , one for integer (0-9), one for currency (0.00). > > How can I avoid false input? > What would be the best way to show the values if there would be a display mask? > > TIA > > ralf > |
Tue, Sep 17 2013 1:41 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Ralf,
<< . at the moment I'm trying to find all the workarounds for the js bugs in EWB.. . really hard work.. >> What JS bugs are you referring to ? Tim Young Elevate Software www.elevatesoft.com |
This web page was last updated on Saturday, January 18, 2025 at 08:56 AM | Privacy PolicySite Map © 2025 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |