Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / pas2js / 2020-08

TTextInputWidget how to set its label

3 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Mgr. Janusz Chmiel

Is it possible to assign some TTextInputWidget object A label? Or I would had to use other input widget for such task? If yes, how to set The value?
The procedure

    procedure SetLabelFor(AValue: TWebWidget);

I need to set A label for several editable input fields. It will be a wrong words and respondent must type The right words which do not have randomly mixed characters.
To be more precise.
Try to imagine form with one editable input field which contain user name label or value??
When screen reader Will get on This object, his screen reader will inform him about username label in this editable field. But editable field is empty. The user name string is not The part of The editable field, editable field is not prefilled.
Is it possible to achieve such behaviour with htmlwidgets unit? Or for now not? If no, how complex would be to implement this feature on future? Thank you very much for yours time and help.

Reply by email

Michael Van Canneyt
to Mgr. Janusz Chmiel
Mgr. Janusz Chmiel wrote 11 lines
Is it possible to assign some TTextInputWidget object A label? Or I would had to use other input widget for such task? If yes, how to set The value? The procedure procedure SetLabelFor(AValue: TWebWidget); I need to set A label for several editable input fields. It will be a wrong words and respondent must type The right words which do not have randomly mixed characters. To be more precise. Try to imagine form with one editable input field which contain user name label or value??

You must create a separate widget for this.

Please check TLabelWidget.

MyPage:=TWebPage.Create(Self);
MyInput:=TTextInputWidget.Create(Self);
MyLabel:=TLabelwidget.Create(Self);
MyLabel.Text:='Name';
MyLabel.LabelFor:=MyInput;
// Order is important.
MyLabel.Parent:=MyPage;
MyInput.Parent:=MyPage;

Michael.

Reply by email

Mgr. Janusz Chmiel
to Michael Van Canneyt

Oh yes. You are awesome man. It was what I have wanted. Thank you for yours fast response. I will test it. And my soft mother will analyse The screen. I will try to use setalign procedure to give every object to left allingment.

Reply by email