Edit

TsgcHTMLComponent_Edit — a single-line text input with a label, help text, input type and dataset binding that renders a Bootstrap 5 form-control, in Delphi, C++ Builder and .NET.

TsgcHTMLComponent_Edit

A standalone text input that emits a labelled Bootstrap <input>. Set the name, label and input type, then read the HTML property. It ships in the same unit as the sibling Memo, CheckBox and RadioGroup inputs.

Component class

TsgcHTMLComponent_Edit

Renders

Bootstrap 5 form-control input

Languages

Delphi, C++ Builder, .NET

Create it, configure it, render it

Set Name, Label_, InputType and a Placeholder, then read HTML (or drop it into a TsgcHTMLTemplate_Bootstrap page).

uses
  sgcHTML_Enums, sgcHTML_Component_Edit;

var
  oEdit: TsgcHTMLComponent_Edit;
begin
  oEdit := TsgcHTMLComponent_Edit.Create(nil);
  try
    oEdit.Name := 'email';
    oEdit.Label_ := 'Email address';
    oEdit.InputType := itEmail;
    oEdit.Placeholder := 'you@example.com';
    oEdit.HelpText := 'We never share it.';
    oEdit.Required := True;

    WebModule.Response := oEdit.HTML;   // Bootstrap form-control
  finally
    oEdit.Free;
  end;
end;

// Or bind it to a dataset field:
oEdit.DataField := 'Email';
oEdit.DataSource := dsCustomer;
// includes: sgcHTML_Enums.hpp, sgcHTML_Component_Edit.hpp

TsgcHTMLComponent_Edit *oEdit = new TsgcHTMLComponent_Edit(NULL);
try
{
  oEdit->Name = "email";
  oEdit->Label_ = "Email address";
  oEdit->InputType = itEmail;
  oEdit->Placeholder = "you@example.com";
  oEdit->HelpText = "We never share it.";
  oEdit->Required = true;

  String html = oEdit->HTML;   // Bootstrap form-control
}
__finally
{
  delete oEdit;
}
using esegece.sgcWebSockets;

var edit = new TsgcHTMLComponent_Edit();
edit.Name = "email";
edit.Label_ = "Email address";
edit.InputType = TsgcHTMLInputType.itEmail;
edit.Placeholder = "you@example.com";
edit.HelpText = "We never share it.";
edit.Required = true;

string html = edit.HTML;   // Bootstrap form-control

Key properties & methods

The members you reach for most often.

Identity

Name sets the field name, Label_ the visible caption and EditID the element id (defaults to edit_<Name>).

Value & hint

Value seeds the input, Placeholder shows ghost text and HelpText adds a Bootstrap form-text hint below the field.

Input type

InputType is a TsgcHTMLInputTypeitText, itEmail, itPassword, itNumber, itTel, itURL, itDate, itColor, itRange, itFile and more.

State

Required, Disabled and ReadOnly flag the input for validation and editing.

Dataset binding

DataField plus an assigned DataSource fills Value from the current record.

Output & siblings

HTML returns the labelled form-control. The same unit declares the sibling TsgcHTMLComponent_Memo, TsgcHTMLComponent_CheckBox and TsgcHTMLComponent_RadioGroup inputs.

Keep exploring

All sgcHTML ComponentsBrowse the full feature matrix of 60+ components.
Download Free TrialThe 30-day trial ships the 60.HTML demo projects.
PricingSingle, Team and Site licenses with full source code.

Ready to Get Started?

Download the free trial and start building web UIs in Delphi, C++ Builder and .NET.