Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • B bootstrap
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 263
    • Issues 263
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 114
    • Merge requests 114
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Bootstrap
  • bootstrap
  • Issues
  • #24624
Closed
Open
Issue created Oct 31, 2017 by Administrator@rootContributor

What’s the correct mark-up for custom radios and server-side validation?

Created by: martinbean

I’m having trouble rendering stacked custom radios with server-side validation.

My raw mark-up looks like this (a Laravel Blade template):

<div class="form-group">
    <label class="form-control-label">Category</label>
    <div class="custom-controls-stacked">
        @foreach($categories as $id => $name)
            <label class="custom-control custom-radio">
                <input type="radio" id="category-{{ $id }}" name="category_id" value="{{ $id }}" class="custom-control-input" {{ old('category_Id') == $id ? 'checked ' : '' }}/>
                <span class="custom-control-indicator"></span>
                <span class="custom-control-description">{{ $name }}</span>
            </label>
        @endforeach
    </div>
    @foreach($errors->get('category_id') as $error)
        <div class="invalid-feedback">{{ $error }}</div>
    @endforeach
</div>

Where is the appropriate place to put the .is-invalid class that both makes the radio inputs red, and displays the <div class="invalid-feedback"> elements?

Assignee
Assign to
Time tracking