We have developed a web application that manages man-hours. Language: Java (Spring), JavaScript
procedure
Project code input screen
Task addition (and modification) screen
Task viewing screen
As I wrote in Previous article, for example, in JavaScript
target.html('<a th:href="@{/hello}">sample</a>');
Even if I wrote, the a tag did not work.
<script type="text/javascript" th:inline="javascript">
const link = /*[[@{/hello}]]*/'';
target.html('<a href="' + link + '">sample</a>');
</script>
I solved it by writing.
In this way, I struggled with the fact that Thymeleaf's `th:`
cannot be used in JavaScript.
`form``` tag inside the
`table``` tagFor example
<table>
<tr>
<th>#</th>
<th>name</th>
<th>button</th>
</tr>
<tr>
<form>
<td>1</td>
<td><input type="text"/></td>
<td><input type="submit"></td>
</form>
</tr>
<tr>
<form>
<td>2</td>
<td><input type="text" /></td>
<td><input type="submit"></td>
</form>
</tr>
</table>
If it's an image,
This is the case. Looking at this with Chrome's developer tools, ...
Strange. .. .. `` `form``` tag, don't close it there. .. ..
input
tag.By doing this, you can send the value value of input
corresponding to the id of the `` form``` tag. By the way, it seems that the ``` form``` tag can be written anywhere above or below the
`input``` tag.
In the above example
<table>
<tr>
<th>#</th>
<th>name</th>
<th>button</th>
</tr>
<tr>
<form id="form_01"></form>
<td>1</td>
<td><input type="text" form="form_01" /></td>
<td><input type="submit" form="form_01"></td>
</tr>
<tr>
<form id="form_02"></form>
<td>2</td>
<td><input type="text" form="form_02" /></td>
<td><input type="submit" form="form_02"></td>
</tr>
</table>
Looking at the developer tools
It should look like this! Probably this will work.
that's all. Thank you for reading to the end.
form tags cannot be nested & how to deal with them How to write HTML5 FORM and INPUT separately
Recommended Posts