Skip to content
Snippets Groups Projects
Commit f6149996 authored by Rhys Nute's avatar Rhys Nute
Browse files

updated form

parent 15d7b383
No related branches found
No related tags found
2 merge requests!38Draft: Businesses,!31Resolve "As a user, I want to see a page of local authorities so that I can easily source contact details for a variety of different local authorities."
......@@ -31,10 +31,10 @@ public class organisationControllers {
}
@Autowired
private localAuthorityRepository localAuthorityRepository;
@PostMapping("/local-auth-data1")
@PostMapping("/local-auth-data")
public ModelAndView localAuthSent(@Valid @ModelAttribute("localAuthority")localAuthority localAuthority, BindingResult bindingResult, Model model ) {
if (bindingResult.hasErrors()){
ModelAndView modelAndView = new ModelAndView("local-auth-data1", model.asMap());
ModelAndView modelAndView = new ModelAndView("local-auth-data", model.asMap());
return modelAndView;
}else{// converts user input using the organisation constructor into a submittable format to the sql table
......
......@@ -19,7 +19,7 @@ public class localAuthority {
private URL website;
@Override
public String toString() {
return "localAuthority{" +
return "localAuthority" +
localAuthorityName + '\'' +
address1 + '\'' +
address2 + '\'' +
......@@ -27,16 +27,14 @@ public class localAuthority {
county + '\'' +
postcode + '\'' +
website +
'}';
'.';
}
public String getLocalAuthorityName() {
return localAuthorityName;
}
public String getAddress1() {
return address1;
}
public String getAddress1() { return address1; }
public String getAddress2() {
return address2;
......
......@@ -11,30 +11,30 @@
<body>
<div id="container1">
<h2>Enter your Local authority</h2>
<form action="/local-auth-data1" id="data" name="data" method="post">
<form action="/local-auth-data" id="data" name="data" method="post" th:object="${localAuthority}">
<br>
<label for="localAuthorityName">Enter your local authority
<input type="text" field="localAuthorityName" name="authority_name" id="localAuthorityName">
<label>Enter your local authority
<input type="text" th:field="*{localAuthorityName}">
</label><br><br>
<label for="address1">Please enter first line of your address
<input type="text" name="address_1" id="address1">
<label>Please enter first line of your address
<input type="text" th:field="*{address1}">
</label><br><br>
<label for="address2">Please enter second line of your address (optional)
<input type="text" name="address_2" id="address2">
<label>Please enter second line of your address (optional)
<input type="text" th:field="*{address2}">
</label><br><br>
<label for="city">Please enter the City/Town
<input type="text" name="city" id="city">
<label>Please enter the City/Town
<input type="text" th:field="*{city}">
</label><br><br>
<label for="county">Please enter you county (optional)
<input type="text" name="county" id="county">
<label>Please enter you county (optional)
<input type="text" th:field="*{county}">
</label><br><br>
<label for="postcode">Please enter your postcode
<input type="text" name="post_code" id="postcode">
<label>Please enter your postcode
<input type="text" th:field="*{postcode}">
</label><br><br>
<label for="website">Please enter your website address
<input type="url" name="web_site" id="website">
<label>Please enter your website address
<input type="text" th:field="*{website}">
</label><br><br>
<input type="submit" value="Submit">
<input type="submit">
</form>
</div>
</body>
......
......@@ -10,8 +10,8 @@
<body>
<h1>Local Authorities</h1>
<div id="councils">
<ul th:each="localauthorities:${localAuthority}">
<li th:text="${localauthorities}"></li>
<ul th:each="localAuthority:${localAuthority}">
<li th:text="${localAuthority}"></li>
</ul>
</div>
<a href="/localForm" id="authority"><button>Local Authorities please enter here</a></button>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment