Creates an HTML Textbox as an input element.


Return Value

Html string for text box.


The name/id of the HTML control.

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.

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).


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

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


<%= 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-2021 • Updated: 07/01/20
Comment or report problem with topic