Form

Wraps forms

Form

Container for form

<!-- form.blade.php -->
<form class="c-form js-form-validation" id="662a185754afc" data-uid="662a185754b03" method="POST" action="?q=form_component">

    
    
    <!-- field.blade.php -->
<div class="c-field c-field--text c-field--md c-field--radius-md" id="662a185754928" data-uid="662a18575494e">
    
            <label class="c-field__label " for="input_662a185754928" id="label_662a185754928">
            Enter text
                    </label>
            
    <div class="c-field__inner c-field__inner--text">
        
        
        
        
                    
            
            <input id="input_662a185754928" value="" aria-labelledby="label_662a185754928" type="text" name="text" autocomplete="on">
            <div class="c-field_focus-styler u-level-top"></div> 

                    
        
            <!-- icon.blade.php -->
    <span class="c-icon c-field__suffix c-field__error-icon c-icon--error-outline c-icon--material c-icon--material-error_outline material-symbols-outlined material-symbols-outlined--filled c-icon--size-md" aria-hidden="true" material-symbol="error_outline" role="img" aria-label="Icon: Undefined" alt="Icon: Undefined" data-nosnippet="" translate="no" data-uid="662a1857549ed">
            </span>

        
            <!-- icon.blade.php -->
    <span class="c-icon c-field__suffix c-field__success-icon c-icon--check-circle-outline c-icon--material c-icon--material-check_circle_outline material-symbols-outlined material-symbols-outlined--filled c-icon--size-md" aria-hidden="true" material-symbol="check_circle_outline" role="img" aria-label="Icon: Undefined" alt="Icon: Undefined" data-nosnippet="" translate="no" data-uid="662a185754a3b">
            </span>

    </div>

    
    </div>

        <button class="c-button c-button__filled c-button__filled--primary c-button--md" target="_top" type="basic" aria-label="Submit" data-uid="662a185754aa4">   
     <span class="c-button__label">         
        
                    <span class="c-button__label-text ">
                Submit
            </span>
        
    </span> </button>
</form>
@form([
    'method' => 'POST',
    'action' => '?q=form_component'
])
    @field([
        'type' => 'text',
        'name' => 'text',
        'label' => "Enter text"
    ])
    @endfield

    @button([
        'text' => 'Submit',
        'color' => 'primary',
        'type' => 'basic'
    ])
    @endbutton

@endform

Blade component parameters

Key Default value Type Available values Description
method POST string - Set to POST by default
action # string - Path to file, set to # by default
validation true boolean - Validation method toggle on off
errorMessage string - If filled: Gives a general error message when form is invalid
validateMessage string - If filled: Gives a general success message when form is valid
id string - The DOM id of the component.
classList [] array - Array containing wrapping classes array
attributeList [] array - Array containing keys and values rendered as attributes
containerAware false boolean true/false Makes the component container aware. Appends modifiers --size--xs/sm/md/lg to the component.
Settings location: /var/www/webroot/ROOT/vendor/helsingborg-stad/component-library/source/php/Component/Form/form.json