|
<< Click to Display Table of Contents >> Navigation: Forum > TIWEdit and HTML legend property |
04-19-2020, 10:59 PM:
I am using Intraweb 14.2.7 with Rad Studio Tokyo 10.2.3 (C++ Builder)
I would like to know how I can add a legend to a TIWEdit
I tried the solution below, but it does not work. The legend is not displayed
CSS definition
legend
{
display: block;
padding-left: 10px;
border: none;
background: none;
}
Then in my application
UnicodeString LegendText="username";
TIWEdit1->ExtraTagParams->Add("legend=" + LegendText);
04-24-2020, 05:29 AM:
Legend is a tag itself, not an attribute of the input tag. Legend most of the times is also part of a fieldset tag.
You can tell IWRegion to render itself as a Legend tag using OnHTMLTag event of the IWRegion:
procedure TIWForm1.IWRegion1HTMLTag(ASender: TObject; ATag: TIWHTMLTag);
begin
ATag.Tag := 'legend';
end;
The code in C++ is analogous.
04-27-2020, 02:39 AM:
I tried that solution but nothing is showing. Not drawing.
I know that the legend must be included into a fieldset using an HTML code like below:
<fieldset>
<legend>My Legend</legend>
<input type="TEXT" id="TIWEDIT1">
</fieldset>
But in this case the TIWEDIT is aldready created at design time.
Am I missing something ?
04-27-2020, 05:12 PM:
Hi, try this:
Code:
<fieldset>
<legend>My Legend</legend>
{%TIWEDIT1%}
</fieldset>
I use in templates with bootstrap:
Code:
<div class="row">
<div class="col-md-6 col-xs-12">
<div class="form-group">
<label for="inputEMAIL">E-Mail</label>
{%IWDBEdit_EMail%}
</div>
</div>
</div>