Last active
April 11, 2019 17:11
-
-
Save M0r13n/333349645324c5f211c23e1fa3875763 to your computer and use it in GitHub Desktop.
Flask WTF-Form - Custom rendering a Form with select
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="row text-left"> | |
<div class="col-md-4 col-md-offset-4"> | |
<form action="" method="POST" role="form" class="form"> | |
<!--Errors + CSRF--> | |
{{ form.hidden_tag() }} {{ wtf.form_errors(form, hiddens="only") }} | |
{% for field, errors in form.errors.items() %} | |
<div class="alert alert-error"> | |
{{ form[field].label }}: {{ ', '.join(errors) }} | |
</div> | |
{% endfor %} | |
<!--Form Fields--> | |
<div class="form-group required"> | |
<label class="control-label" for="device_name">Modellname</label> | |
{{ form.device_name(class="form-control",id="device_name",required="required",type="text",placeholder="J3 2017") }} | |
</div> | |
<div class="form-group required"> | |
<label class="control-label" for="device_code">Modellnummer</label> | |
{{ form.device_code(class="form-control",id="device_code",required="required",type="text",placeholder="J320F") }} | |
<span class="text-left text-muted">{{ form.device_code.description }}</span> | |
</div> | |
<div class="form-group required"> | |
<label for="manufacturer">Herrsteller</label> | |
<label class="control-label" for="manufacturer">Herrsteller</label> | |
{{ form.manufacturer_id(class="form-control",id="manufacturer",required="required",type="select") }} | |
</div> | |
{{ form.submit(class="btn btn-success btn-block") }} | |
</form> | |
</div> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment