I have created a form using Themileaf, this form contains a textfield and label for it
This template is:
This template is:
This template is:
P >
& lt; Form action = "#" th: action = "@ {/ test}" th: object = "$ {nameBean}" method = "post" & gt; & Lt; Div class = "form-group" th: classappend = "$ {# fields.has errors ('name')} is" error "& gt; label class =" control-label "th: for = "$ {# Ids.next ('name')}" & gt; name & lt; / label & gt; & lt; input type = "text" class = "form-control" placeholder = "Enter your name" Th: field = "* {name}" /> & lt; / div & gt; & gt; button type = "submit" class = "btn btn-default" & gt; send & lt; / button & Gt; & lt; / form & gt;
and it is HTML generated:
form action = "/ test" method = "Name1" & gt; name for & lt; div class = "form-group" & gt; label class = "control-label" & lt; / label & gt; & Lt; input type = "text" Class = "form-control" placeholder = "Enter your name" id = "name" name = "name" value = "" & gt; & lt; / div & gt; & lt; button type = "submit" Class = "btn btn-default" & gt; send & lt; / button & gt; & lt; / form & gt;
according to yourmeleaf guide. Must be, but the text file ID must have a number attached. Why is this number not attached?
As far as I understand you only need it for iterations. Generally, you can use only for = 'name'
. If you use seq, then I believe that the input code will contain th: id = # idssec ('name ')
will happen correctly.
No comments:
Post a Comment