Input type text
<div class="formelement">
    <label for="inputtext">Label</label>
    <div class="input">
        <input type="text" id="inputtext">
    </div>
</div>

Placeholder
<input type="text" id="whatever" placeholder="Placeholder text">

Disabled input
<div class="formelement">
    <div class="input">
        <label for="disabledinput">Disabled input</label>
        <input type="text" id="disabledinput" disabled>
    </div>
</div>

Input type date
<div class="formelement">
    <label for="inputtypedate">Input type date</label>
    <div class="input">
        <input type="date" id="inputtypedate">
    </div>
</div>

Select
<div class="formelement">
    <label for="select">Label</label>
    <div class="input select">
        <select id="select">
            <option>1</option>
            <option>2</option>
            <option>3</option>
            <option>4</option>
            <option>5</option>
        </select>
    </div>
</div>

Fancy select
<div class="formelement">
    <label for="fancy">Label</label>
    <div class="input select">
        <div class="fancyselect">
            <select id="fancy">
                <option>1</option>
                <option>2</option>
                <option>3</option>
            </select>
        </div>
    </div>
</div>

Multiselect
<div class="formelement">
    <label for="multiselect">Label</label>
    <div class="input select">
        <select multiple="multiple" size="5" id="multiselect">
             <option>1</option>
             <option>2</option>
             <option>3</option>
             <option>4</option>
             <option>5</option>
        </select>
    </div>
</div>

File upload
<div class="formelement">
    <label for="browsefile">Browse file</label>
    <div class="input">
        <input id="browsefile" type="file">
    </div>
</div>

File upload
<div class="formelement">
    <label for="browsefiles">Images</label>
    <div class="input">
        <label class="button file-input-button" tabindex="0" role="button">
            <span>Last opp bilde</span>
            <input type="file" name="browsefiles" id="browsefiles" accept="image/jpeg, image/png, image/gif" autocomplete="off" tabindex="-1" aria-hidden="true">
        </label>
    </div>
</div>

Textarea
<div class="formelement">
    <label for="textarea">Textarea</label>
    <div class="input">
        <textarea id="textarea" rows="3"></textarea>
    </div>
</div>

Disabled textarea
<div class="formelement">
    <label for="disabledtextarea">Textarea</label>
    <div class="input">
        <textarea id="disabledtextarea" rows="3" disabled></textarea>
    </div>
</div>

Radio buttons
<div class="formelement">
    <fieldset>
        <legend>Choose one</legend>
        <div class="input">
            <label>
                <input type="radio" name="radios" checked>
                Nothing
            </label>

            <label>
                <input type="radio" name="radios">
                Something
            </label>

            <label>
                <input type="radio" name="radios">
                Other
            </label>
        </div>
    </fieldset>
</div>
Choose one

Fancy radio buttons
<div class="formelement">
    <fieldset>
        <legend>Choose one</legend>
        <div class="input">
            <div class="fancyinput">
                <input type="radio" id="fancyradio1" name="fancyradio">
                <label for="fancyradio1">Nothing</label>
            </div>

            <div class="fancyinput">
                <input type="radio" id="fancyradio2" name="fancyradio">
                <label for="fancyradio2">Something</label>
            </div>

            <div class="fancyinput">
                <input type="radio" id="fancyradio3" name="fancyradio">
                <label for="fancyradio3">Other</label>
            </div>
        </div>
    </fieldset>
</div>
Choose one

Button group (based on radio inputs)
<fieldset class="formelement">
    <legend>I want to</legend>
    <div class="input ">
        <div class="button-group line" role="radiogroup">
            <input tabindex="0" data-selector="" id="radio-input-SELL" type="radio" value="SELL" name="trade_type" checked="">
            <label class="pam size1of4 centerify truncate" for="radio-input-SELL">Selge</label>
            <input tabindex="0" data-selector="" id="radio-input-GIVEAWAY" type="radio" value="GIVEAWAY" name="trade_type">
            <label class="pam size1of4 centerify truncate" for="radio-input-GIVEAWAY">Gi bort</label>
            <input tabindex="0" data-selector="" id="radio-input-WANTED" type="radio" value="WANTED" name="trade_type">
            <label class="pam size1of4 centerify truncate" for="radio-input-WANTED">Stæle</label>
            <input tabindex="0" data-selector="" id="radio-input-whatever" type="radio" value="WHATEVER" name="trade_type">
            <label class="pam size1of4 centerify truncate" for="radio-input-whatever">Ete</label>
        </div>
    </div>
</fieldset>
I want to
I want to

Checkboxes
<div class="formelement">
    <fieldset>
        <legend>Select more than one</legend>
        <div class="input">
            <label>
                <input type="checkbox" checked>
                Nothing
            </label>

            <label>
                <input type="checkbox">
                Something
            </label>

            <label>
                <input type="checkbox">
                Other
            </label>
        </div>
    </fieldset>
</div>
Select more than one

Fancy checkboxes
<div class="formelement">
    <fieldset>
        <legend>Select more than one</legend>
        <div class="input">
            <div class="fancyinput">
                <input type="checkbox" id="fancycheckbox1">
                <label for="fancycheckbox1">Nothing</label>
            </div>

            <div class="fancyinput">
                <input type="checkbox" id="fancycheckbox2">
                <label for="fancycheckbox2">Something</label>
            </div>

            <div class="fancyinput">
                <input type="checkbox" id="fancycheckbox3">
                <label for="fancycheckbox3">Other</label>
            </div>

            <div class="fancyinput">
                <input type="checkbox" id="fancycheckbox4">
                <label for="fancycheckbox4" class="blockify">
                    <div class="fright">Price or something</div>
                    Block level label for lots of information
                    <div class="d1 stone">Yibbida yibbida</div>
                </label>
            </div>
        </div>
    </fieldset>
</div>
Select more than one

Tagwords input
<a class="tagword editable" href="#">Nice</a>

<p class="editable">
    <a class="tagword" href="#">Nice</a>
    <a class="tagword" href="#">Awsome</a>
    <a class="tagword" href="#">PERDY</a>
    <a class="tagword" href="#">Amazing</a>
    <a class="tagword" href="#">cool</a>
</p>

Hidden (expandable) input
<div>
    <input type="checkbox" class="expandfields" id="expandfields">
    <label for="expandfields" tabindex="0" class="input clickable expandlabel primary-blue">Pris i kr</label>
    <div class="formelement">
        <label for="price">Pris i kr</label>
        <div class="input">
            <input type="text" id="price">
        </div>
    </div>
</div>

Needs a javascript to set focus on the text input and disable the hidden checkbox on expand. To expand the input by default, set the checked attribute on the checkbox.

Mandatory fields and validation

.required
.invalid .required
.valid .required
<div class="formelement invalid">
<label class="required"> ... </label>
...
</div>
Standard form
That's not a fruit, dude!
Success!

Javascript module for form validation

For validation and error indication, use common-validator-js (here is the git repo).

Additional data-attributes will be needed for the validator to work. Read the validator's readme for more details.