2019-08-03 15:01:17 -08:00
|
|
|
{{define "title"}}Example - Flash Messages{{end}}
|
|
|
|
{{define "style"}}
|
|
|
|
|
|
|
|
{{end}}
|
|
|
|
{{define "content"}}
|
2019-08-05 16:48:32 -08:00
|
|
|
<h3 class="mt-5">Inline Validation Example</h3>
|
2019-08-03 15:01:17 -08:00
|
|
|
<p>Any field error that is not displayed inline will still be displayed as apart of the the validation at the top of the page.</p>
|
|
|
|
<form class="user" method="post" novalidate>
|
|
|
|
<div class="form-group">
|
|
|
|
<input type="email" class="form-control form-control-user {{ ValidationFieldClass $.validationErrors "Email" }}" name="Email" value="{{ $.form.Email }}" placeholder="Enter Email Address...">
|
|
|
|
{{template "invalid-feedback" dict "validationDefaults" $.validationDefaults "validationErrors" $.validationErrors "fieldName" "Email" }}
|
|
|
|
</div>
|
|
|
|
|
2019-08-05 16:48:32 -08:00
|
|
|
<button class="btn btn-purple btn-user ">
|
2019-08-03 15:01:17 -08:00
|
|
|
Submit Form
|
|
|
|
</button>
|
2019-08-07 19:37:22 -08:00
|
|
|
|
|
|
|
<!-- hidden_field is not included in the form to show how inline validation errors
|
|
|
|
are removed from list of validation issues in the flash message. When submitting an
|
|
|
|
invalid email address, the flash message includes the validation issues for hidden_field
|
|
|
|
but does not include in for email. Instead the email validation issue is displayed inline -->
|
2019-08-03 15:01:17 -08:00
|
|
|
<hr>
|
|
|
|
</form>
|
|
|
|
{{end}}
|
|
|
|
{{define "js"}}
|
|
|
|
|
|
|
|
{{end}}
|