Atozed Forums

Full Version: TIWEdit and HTML legend property
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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);
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.
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 ?
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>