wwHtmlHelpers.HtmlTextBox
less than 1 minute to read

Creates an HTML Textbox as an input element.

HtmlTextBox(lcName,lcValue,lcAttributes)

Return Value

Html string for text box.

Parameters

lcName
The name/id of the HTML control.

lcValue
The assigned string value for the control. Note that you can apply complex expressions to provide formatting here.

On a Postback operation lcValue is automatically read from Request.Form() if available

You can override this behavior, and always force the value to be used by postfixing with ":FORCED" to the end of the value string.

lcAttributes
Any HTML attributes you want to specify like styles or classes or anything else. Note that you can include type="HTML5FieldType" to override the textbox HTML5 type (see below).

Remarks

You can support custom HTML5 input types like email, date, ipaddress etc. by specifying the type attribute in the lcAttributes parameter:

foxpro
HtmlTextBox("datestart",pcDateStart,[class="date" type="date"])

Example

html
<%= HtmlTextBox("txtCompany",poCustomer.oData.Company,; [class="primaryinput" style="background: lightcyan"]) %> <!-- always use the assigned value rather than auto-postback by using ":FORCED" with value --> <%= HtmlTextBox("txtFixed",poCustomer.oData.Fixed + ":FORCED",; [class="primaryinput" style="background: lightcyan"]) %> <!-- HTML5 input types are supported with type="email" in lcAttributes parameter --> <%= HtmlTextBox("txtEmail",poCustomer.oData.Email,; [type="email" class="primaryinput"]) %>

See also:

Library wwHtmlHelpers | wwrequest::FormOrValue

© West Wind Technologies, 1996-2024 • Updated: 07/01/20
Comment or report problem with topic