[Pas2js] TTextInputWidget how to set its label
Michael Van Canneyt
michael at freepascal.org
Thu Aug 27 16:51:58 CEST 2020
On Thu, 27 Aug 2020, Mgr. Janusz Chmiel wrote:
> 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.
More information about the Pas2js
mailing list