add form validation
This commit is contained in:
parent
82f11b254b
commit
3f2cbcea33
8 changed files with 131 additions and 18 deletions
|
@ -20,8 +20,10 @@
|
|||
<div class="text-right">
|
||||
<form action="/threads/{{.Thread.ID}}/{{.Post.ID}}" method="POST">
|
||||
{{.CSRF}}
|
||||
<textarea name="content" class="form-control border-0 border-bottom-1 p-3"
|
||||
placeholder="What are your thoughts?" rows="4"></textarea>
|
||||
<textarea name="content" class="form-control border-0 border-bottom-1 p-3 {{with .Form.Errors.Content}}is-invalid{{end}}"
|
||||
placeholder="What are your thoughts?" rows="4">
|
||||
{{- with .Form.Content}}{{.}}{{end -}}
|
||||
</textarea>
|
||||
<div class="border-top p-1">
|
||||
<button class="btn btn-primary btn-sm">Comment</button>
|
||||
</div>
|
||||
|
|
Reference in a new issue