Page 1 of 1

Input validation

Posted: Tue Mar 26, 2024 6:14 pm
by GMKai
Is there a way to indicate required fields in a group of e.g.

could maybe look like this:

Code: Select all

<textentry id="mytextentry" maxlen="3" accept="0123456789"/>
But how to indicate the Textentry is required?

Re: Input validation

Posted: Tue Mar 26, 2024 10:02 pm
by plouf
The defacto way to visually inform user is to use an asterisk in descritpion


Username* [. ]
Password. [. ]
Country [ ] (optional)

Programticany check content, after user has press save/submit and if empty popup a requester... Its all done in your code :-)

Re: Input validation

Posted: Tue Mar 26, 2024 10:14 pm
by evil
Alternatively you might setup a notify on Textentry.Text. So you can check for an entered string and enable/disable a submit button as desired.

Re: Input validation

Posted: Wed Mar 27, 2024 7:30 am
by GMKai
Thanks alot.

I was going to stick a red asteriks to a Label, but Label does not support textformating, right?

Isn't there a nicer way to hand over an object and get validation of missing required fields as a present, to avoid manually checking the attributes of an object to avoid empty/null values?

Re: Input validation

Posted: Wed Mar 27, 2024 7:35 am
by plouf
Text formating suuport bold italics underline

There both ways nice ;-)

Re: Input validation

Posted: Mon Apr 08, 2024 7:43 pm
by airsoftsoftwair
GMKai wrote: Wed Mar 27, 2024 7:30 am Isn't there a nicer way to hand over an object and get validation of missing required fields as a present, to avoid manually checking the attributes of an object to avoid empty/null values?
Well, that's definitely something your script should handle. I don't think there's any GUI toolkit that provides such features. You must manually check that and react accordingly.