1
0
mirror of https://github.com/raseels-repos/golang-saas-starter-kit.git synced 2025-06-06 23:46:29 +02:00
golang-saas-starter-kit/cmd/web-app/templates/content/examples-flash-messages.gohtml

28 lines
1.2 KiB
Plaintext
Raw Permalink Normal View History

2019-08-03 15:01:17 -08:00
{{define "title"}}Example - Flash Messages{{end}}
{{define "style"}}
{{end}}
{{define "content"}}
<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>
<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}}