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 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.
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.
TsgcHTMLComponent_Edit
Bootstrap 5 form-control input
Delphi, C++ Builder, .NET
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
The members you reach for most often.
Name sets the field name, Label_ the visible caption and EditID the element id (defaults to edit_<Name>).
Value seeds the input, Placeholder shows ghost text and HelpText adds a Bootstrap form-text hint below the field.
InputType is a TsgcHTMLInputType — itText, itEmail, itPassword, itNumber, itTel, itURL, itDate, itColor, itRange, itFile and more.
Required, Disabled and ReadOnly flag the input for validation and editing.
DataField plus an assigned DataSource fills Value from the current record.
HTML returns the labelled form-control. The same unit declares the sibling TsgcHTMLComponent_Memo, TsgcHTMLComponent_CheckBox and TsgcHTMLComponent_RadioGroup inputs.