Advanced Form
Searchable select, a Markdown editor and a file drop zone.
How to use it
Copy any example below and paste it indata-select- Tom Select. Add
multiplefor tags,data-select-createto allow new values. data-editor- EasyMDE, a Markdown editor on a
<textarea>. The textarea stays the form control, so the form submits the Markdown with no extra wiring. data-upload- Dropzone. Point
data-upload-urlat a real endpoint; without one it is presentation only.
Searchable and multi-value select
<div class="grid grid-cols-1 gap-4 sm:grid-cols-2">
<div>
<label class="form-label" for="a-country">Country</label>
<select id="a-country" class="form-select" data-select data-select-placeholder="Search countries">
<option value="">Choose one</option>
<option>Indonesia</option>
<option>Thailand</option>
<option>Singapore</option>
<option>Malaysia</option>
<option>Viet Nam</option>
</select>
</div>
<div>
<label class="form-label" for="a-tags">Tags</label>
<select id="a-tags" class="form-select" data-select data-select-create multiple>
<option selected>design-system</option>
<option selected>accessibility</option>
<option>billing</option>
<option>platform</option>
</select>
</div>
</div>
Markdown editor on a textarea
Markdown. The textarea is what the form submits.
<div>
<label class="form-label" for="a-body">Description</label>
<textarea id="a-body" name="body" data-editor data-editor-placeholder="Write the listing copy…"></textarea>
<p class="form-help">Markdown. The textarea is what the form submits.</p>
</div>
File drop zone
Up to 4 MB per file.
<div>
<label class="form-label" for="a-files">Attachments</label>
<form id="a-files" class="dropzone" data-upload
data-upload-message="Drop files here, or click to browse"
data-upload-max="4"></form>
<p class="form-help">Up to 4 MB per file.</p>
</div>