CS4 webControl25

CS4 webControl25

CommentBox25

CommentBox25

The CommentBox25 control provides a textbox with optional suggestion support, placeholder text, label, and icon. It is commonly used for entering remarks, notes, or descriptive text where users may benefit from predefined suggestions. The control also supports required-field validation and customizable sizes.

  • Purpose:
    • To capture comments or descriptive text from users.
    • To offer auto-suggestion values through a datalist.
    • To provide consistent styling across form inputs.
  • GetHtml(Properties):

    Generates the complete HTML structure for the comment box control.

    • Creates a label (optional).
    • Supports required validation indicator (*).
    • Renders an input box with placeholder and optional icon.
    • Includes a datalist for suggestion items.
    • Applies size formatting via width values.
  • Properties Class:

    The Properties object defines how the CommentBox25 will be rendered.

    • ControlId – Unique ID and name of the control.
    • Label – Text label displayed above the input.
    • PlaceHolder – Placeholder text shown inside the input.
    • SelectedValue – Default selected value.
    • IsRequired – If true, a red asterisk (*) appears.
    • Icon – FontAwesome icon displayed inside the textbox.
    • SuggestUrl – URL that provides suggestion values (optional).
    • Size – Width preset for the input box.
    • ValueList – List of suggestion items shown in a datalist.
  • Size Options:
    • S1 – 50px
    • S2 – 100px
    • S3 – 150px
    • S4 – 200px
    • S5 – 250px
    • Max – 100% width
    • Auto – Auto width
  • Sample Code:
    var Comment = new CommentBox25.Properties()
    {
        ControlId = "Status",
        Label = "Comment",
        SuggestUrl = "sathya.in",
        IsRequired = true,
        Icon = "fas fa-pen"
    };
    htmlstr += CommentBox25.GetHtml(Comment).ToString();
        
  • Outcome:

    A clean, flexible comment input field with optional suggestions, icons, required indication, and configurable size—ideal for any form requiring user text input with guided assistance.