<div class="form-group">
<label class="d-block">Name:</label>
<select class="custom-select">
<option selected>
Open this select menu
</option>
<option value="1">
Option One
</option>
<option value="2">
Option Two
</option>
</select>
</div>
{% set CType = 'select' %}
{% set attributes = [] %}
{% if required %}
{% set attributes = attributes|merge([' required']) %}
{% endif %}
{% block main %}
<div class="form-group">
{% if name %}
<label class="d-block">{{ name }}</label>
{% endif %}
<select class="custom-select" {{ attributes }}>
<option selected>
Open this select menu
</option>
{% for value in values %}
<option value="{{ loop.index }}">
{{ value }}
</option>
{% endfor %}
</select>
</div>
{% endblock %}
{
"name": "Name:",
"required": false,
"values": [
"Option One",
"Option Two"
]
}
import $ from "jquery";
import 'select2';
// TODO: change from select2 to Choices (https://github.com/jshjohnson/Choices)
$(() => {
$('select').select2({
theme: 'bootstrap4',
minimumResultsForSearch: Infinity
});
});
No notes defined.