UI Patterns → Simple Form Demo

Simple Form Demo

This would be good place to explain anything specific to this form. You can point out important fields and anything to pay special attention to. For more information on how to use those patterns, refer to the navigation on the left.

Indicates required fields

 
Open the calendar popup.

Pattern and Usage

Above is a simple form example. Although there are many different scenarios when laying out a form, this example should capture many common form elements and its patterns for you development.

AخA
 
1
<div class="dnnForm" id="form-demo">
2
    <asp:Label runat="server" CssClass="dnnFormMessage dnnFormInfo" ResourceKey="Intro" />
3
    <div class="dnnFormItem dnnFormHelp dnnClear">
4
        <p class="dnnFormRequired"><asp:Label runat="server" ResourceKey="Required Indicator" /></p>
5
    </div>
6
    <fieldset>
7
        <div class="dnnFormItem">
8
            <dnn:Label runat="server" ControlName="NameTextBox" ResourceKey="Name" />
9
            <asp:TextBox runat="server" ID="NameTextBox" CssClass="dnnFormRequired" />
10
            <asp:RequiredFieldValidator runat="server" ControlToValidate="NameTextBox" 
11
                CssClass="dnnFormMessage dnnFormError" ResourceKey="Name.Required" />
12
        </div>
13
        <div class="dnnFormItem">
14
            <dnn:Label runat="server" ControlName="DescriptionTextBox" ResourceKey="Description" />
15
            <asp:TextBox runat="server" TextMode="MultiLine" ID="DescriptionTextBox" />
16
        </div>
17
        <div class="dnnFormItem">
18
            <dnn:Label runat="server" ControlName="ChoiceDropDown" ResourceKey="Choice" />
19
            <asp:DropDownList runat="server" ID="ChoiceDropDown">
20
                <asp:ListItem Text="-- Make a Choice --" />
21
                <asp:ListItem Text="First Choice" />
22
                <asp:ListItem Text="Second Choice" />
23
            </asp:DropDownList>
24
        </div>
25
        <div class="dnnFormItem">
26
            <dnn:Label runat="server" ControlName="RateRadioButtons" ResourceKey="Rate" />
27
            <asp:RadioButtonList runat="server" ID="RateRadioButtons"
28
                RepeatDirection="Horizontal" CssClass="dnnFormRadioButtons">
29
                <asp:ListItem Text="1" />
30
                <asp:ListItem Text="2" />
31
                <asp:ListItem Text="3" />
32
                <asp:ListItem Text="4" />
33
                <asp:ListItem Text="5" />
34
            </asp:RadioButtonList>
35
        </div>
36
        <div class="dnnFormItem">
37
            <dnn:Label runat="server" ControlName="AgreeCheckbox" ResourceKey="Agree" />
38
            <asp:CheckBox runat="server" ID="AgreeCheckbox" />
39
        </div>
40
        <div class="dnnFormItem">
41
            <asp:Label runat="server" CssClass="dnnFormLabel" AssociatedControlID="StartDatePicker" ResourceKey="Start Date" />
42
            <dnn:DnnDatePicker runat="server" CssClass="dnnFormInput" ID="StartDatePicker" />
43
        </div>
44
    </fieldset>
45
    <ul class="dnnActions dnnClear">
46
        <li><asp:LinkButton runat="server" CssClass="dnnPrimaryAction" ResourceKey="Save" /></li>
47
        <li><asp:HyperLink runat="server" CssClass="dnnSecondaryAction" NavigateUrl="/" ResourceKey="Cancel" /></li>
48
    </ul>
49
</div>
50
            

All of the CSS used for this forms are in default.css