title: What is wrong with my thymeleaf html form here? Why is the Password showing value null?
body: <p>I have a basic form ,which takes in values from the user . The problem is all the html fields with type=text work fine and send the values to my java Back end API ,but only input type=password sends null value to the API.</p>
  
  <p>MY HTML CODE :</p>
  
  <pre><code>&lt;form action="#" th:action="@{/register}" th:object="${register}" method="post"&gt;
              &lt;input id="inputt" placeholder="First Name"  onclick="thisv1()" type="text" th:field="*{fname}" &gt;
              &lt;br&gt;
              &lt;input id="inputt1" placeholder="Last Name" onclick="thisv2()" type="text" th:field="*{lname}"&gt;
              &lt;br&gt;
              &lt;input id="inputt2" placeholder="Email" onclick="thisv3()" type="text" th:field="*{email}"&gt;
              &lt;br&gt;
              &lt;input id="inputt3" placeholder="Password" onclick="thisv4()" type="password" th:value="*{password}"&gt;
              &lt;br&gt;
              &lt;input type="submit" id="submit" name="Submit" value="Submit"&gt;
          &lt;/form&gt;
  </code></pre>
  
  <p>My Spring Controller Code:</p>
  
  <pre><code>              @GetMapping("/register")
                public String form(Model model){
                    model.addAttribute("register",new Register());
                    return "register";
                }
                @PostMapping("/register")
                public  String SubmitForm(@ModelAttribute Register register){
                    DB.addValues(register.getFname(),register.getLname(),register.getEmail(),register.getPassword());
                    return "result";
                }
  </code></pre>
  
  <p>Register Class Code:</p>
  
  <pre><code>public class Register {
  private String fname;
  private String lname;
  private String email;
  private String password;
  public void setFname(String fname){
      this.fname=fname;
  }
  public void setLname(String lname){
      this.lname=lname;
  }
  public void setEmail(String email){
      email=email.toString();
      this.email=email;
  }
  public void setPassword(String Password) {
      this.password = password;
  }
  public String getFname(){
      return fname;
  }
  public String getLname(){
      return lname;
  }
  public String getEmail(){
      return email;
  }
  public String getPassword(){
      return password;
  }}
  </code></pre>
  
  <p>what am i doing wrong here?</p>