CBWIRE
InstallSource CodeIssuesSupport
v3.x
v3.x
  • Introduction
  • Getting Started
  • Configuration
  • How It Works
  • Release History
    • What's New With 3.2
    • What's New With 3.1
    • What's New With 3.0
    • What's New With 2.2
    • What's New With 2.1
    • What's New With 2.0
  • Examples
    • Contact Form
    • Multi-select Input
    • File Upload
  • Resources
  • The Essentials
    • Components
    • Templates
    • Data Properties
    • Computed Properties
    • Actions
    • Events
    • Lifecycle Methods
    • JavaScript
    • Testing
  • Wire Features
    • Validation
    • File Uploads
    • Query String
    • Redirecting
    • WireBox
  • Template Features
    • Directives
    • Loading States
    • Polling
    • Prefetching
    • Offline State
    • Defer Loading
    • Dirty State
  • Integrations
    • ContentBox CMS
    • SPAs with Turbo
    • AlpineJS
Powered by GitBook
On this page
  1. Examples

Multi-select Input

<cfscript>
    data = {
        "heroes": []
    };
</cfscript>

<cfoutput>
    <div>
        <label>
            <select wire:model="heroes" multiple>
                <option value="Batman">Batman</option>
                <option value="Superman">Superman</option>
                <option value="Iron Man">Iron Man</option>
            </select>
        </label>

        <cfif arrayLen( heroes )>
            <div class="mt-4 alert alert-primary">You selected <span class="fw-bold">#arrayToList( heroes )#</span>.</div>
        <cfelse>
            <div class="mt-4 alert alert-danger">Select a hero please.</div>
        </cfif>
    </div>
</cfoutput>
PreviousContact FormNextFile Upload

Last updated 1 year ago