Table of Contents

Class FormFieldViewModel

Namespace
Dynamicweb.Forms
Assembly
Dynamicweb.Forms.dll

Represents a view model for rendering form fields.

public class FormFieldViewModel : ViewModelBase
Inheritance
FormFieldViewModel
Inherited Members
Extension Methods

Properties

Active

Gets or sets a value indicating whether the form field is active.

public bool Active { get; set; }

Property Value

bool

Append

Gets or sets the string to append to the form field value.

public string? Append { get; set; }

Property Value

string

AutoValue

Gets or sets the auto value of the form field.

public string? AutoValue { get; set; }

Property Value

string

Color

Gets or sets the color of the form field.

public string? Color { get; set; }

Property Value

string

CssClass

Gets or sets the CSS class of the form field.

public string? CssClass { get; set; }

Property Value

string

DefaultValue

Gets or sets the default value of the form field.

public string? DefaultValue { get; set; }

Property Value

string

Description

Gets or sets the description of the form field.

public string? Description { get; set; }

Property Value

string

FieldOptions

Gets the collection of form field options.

public IEnumerable<FormFieldOptionViewModel> FieldOptions { get; }

Property Value

IEnumerable<FormFieldOptionViewModel>

GroupId

Gets or sets the group ID of the form field.

public int GroupId { get; set; }

Property Value

int

HideInReceipt

Gets or sets a value indicating whether the form field should be hidden in the receipt.

public bool HideInReceipt { get; set; }

Property Value

bool

HtmlId

Gets or sets the HTML ID of the form field.

public string? HtmlId { get; set; }

Property Value

string

ID

Gets or sets the ID of the form field.

public int ID { get; set; }

Property Value

int

Image

Gets or sets the image of the form field.

public string? Image { get; set; }

Property Value

string

InputPattern

Gets or sets the input pattern of the form field.

public string? InputPattern { get; set; }

Property Value

string

InputType

Gets or sets the input type of the form field. For input fields this is the HTML input type, but the casing is not consistent, so normalize it before comparing or emitting it.

public string? InputType { get; set; }

Property Value

string

IsButton

Gets or sets a value indicating whether the form field is a button.

public bool IsButton { get; set; }

Property Value

bool

IsInput

Gets or sets a value indicating whether the form field is an input field.

public bool IsInput { get; set; }

Property Value

bool

IsList

Gets or sets a value indicating whether the form field is a list field.

public bool IsList { get; set; }

Property Value

bool

IsOther

Gets or sets a value indicating whether the form field is an "Other" field.

public bool IsOther { get; set; }

Property Value

bool

IsTextArea

Gets or sets a value indicating whether the form field is a textarea field.

public bool IsTextArea { get; set; }

Property Value

bool

MaxLength

Gets or sets the maximum length of the form field value.

public int MaxLength { get; set; }

Property Value

int

Name

Gets or sets the name of the form field.

public string? Name { get; set; }

Property Value

string

Placeholder

Gets or sets the placeholder text of the form field.

public string? Placeholder { get; set; }

Property Value

string

Prepend

Gets or sets the string to prepend to the form field value.

public string? Prepend { get; set; }

Property Value

string

Required

Gets or sets a value indicating whether the form field is required.

public bool Required { get; set; }

Property Value

bool

Size

Gets or sets the size of the form field.

public int Size { get; set; }

Property Value

int

Sort

Gets or sets the sort order of the form field.

public int Sort { get; set; }

Property Value

int

SystemName

Gets or sets the system name of the form field.

public string? SystemName { get; set; }

Property Value

string

Text

Gets or sets the text of the form field.

public string? Text { get; set; }

Property Value

string

TextAreaHeight

Gets or sets the height of the textarea form field.

public int TextAreaHeight { get; set; }

Property Value

int

Title

Gets or sets the title of the form field.

public string? Title { get; set; }

Property Value

string

Type

Gets or sets the type of the form field, e.g. Text, Textarea, Select, Radio, Checkbox, Checkboxlist, File, Hidden or Submit.

public string? Type { get; set; }

Property Value

string

Methods

GetOptions()

Retrieves the options for the form field.

public IEnumerable<FormFieldOptionViewModel> GetOptions()

Returns

IEnumerable<FormFieldOptionViewModel>

The collection of form field options.

GetValue()

Retrieves the value to pre-fill the form field with: the auto value (e.g. current user data) if set, otherwise the default value.

public string GetValue()

Returns

string

The value to pre-fill the form field with.

To top