- Learn Data Structures and Algorithms with Golang
- Bhagvan Kommadi
- 67字
- 2021-06-24 15:37:44
The Create template
The Create template consists of Header, Menu, and Footer templates. The form to create customer fields is found in the create template. This form is submitted to a web path—/insert, as shown in the following code snippet (Create.tmpl):
{{ define "Create" }}
{{ template "Header" }}
{{ template "Menu" }}
<br>
<h1>Create Customer</h1>
<br>
<br>
<form method="post" action="/insert">
Customer Name: <input type="text" name="customername" placeholder="customername" autofocus/>
<br>
<br>
SSN: <input type="text" name="ssn" placeholder="ssn"/>
<br>
<br>
<input type="submit" value="Create Customer"/>
</form>
{{ template "Footer" }}
{{ end }}