Input validation

Discuss GUI programming with the RapaGUI plugin here
Post Reply
GMKai
Posts: 140
Joined: Mon Feb 15, 2010 10:58 am

Input validation

Post 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?
plouf
Posts: 473
Joined: Sun Feb 04, 2018 11:51 pm
Location: Athens,Greece

Re: Input validation

Post 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 :-)
Christos
evil
Posts: 177
Joined: Mon Jun 14, 2010 1:38 pm

Re: Input validation

Post 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.
GMKai
Posts: 140
Joined: Mon Feb 15, 2010 10:58 am

Re: Input validation

Post 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?
plouf
Posts: 473
Joined: Sun Feb 04, 2018 11:51 pm
Location: Athens,Greece

Re: Input validation

Post by plouf »

Text formating suuport bold italics underline

There both ways nice ;-)
Christos
User avatar
airsoftsoftwair
Posts: 5450
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Input validation

Post 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.
Post Reply