core/template/components/form_input.html

18 lines
695 B
HTML
Raw Normal View History

2024-10-07 19:10:04 -04:00
{{define "form_input"}}
<div class="input-container">
<label class="form-label" for="{{.ID}}">{{.Label}}</label>
<input type="{{.Type}}" id="{{.ID}}" name="{{.ID}}" placeholder="{{.Placeholder}}" class="form-control{{if ne .Error ""}} error{{end}}"
{{if eq .IsDisabled true}}
disabled
{{end}}
{{if eq .IsRequired true}}
required
{{end}}
2024-10-07 19:10:04 -04:00
{{if ne .Value ""}}
value="{{.Value}}"
{{end}}
aria-describedby="{{.ID}}Help">
{{if ne .Hint ""}}<small id="{{.ID}}Help" class="form-text text-muted">{{.Hint}}</small>{{end}}
{{if ne .Error ""}}<div class="error">{{.Error}}</div>{{end}}
</div>
{{end}}