March 2019
Intermediate to advanced
336 pages
9h 9m
English
The Update template consists of the Header, Menu, and Footer templates, as follows. The form to update customer fields is found in the Update template. This form is submitted to a web path, /alter (Update.tmpl):
{{ define "Update" }} {{ template "Header" }} {{ template "Menu" }}<br><h1>Update Customer</h1> <br> <br> <form method="post" action="/alter"> <input type="hidden" name="id" value="{{ .CustomerId }}" /> Customer Name: <input type="text" name="customername" placeholder="customername" value="{{ .CustomerName }}" autofocus> <br> <br> SSN: <input type="text" name="ssn" value="{{ .SSN }}" placeholder="ssn"/> <br> <br> <input type="submit" value="Update Customer"/> </form>{{ template "Footer" }}{{ end }}
Read now
Unlock full access