Advertisement
Namaru

form-subject

Apr 6th, 2025
379
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 1.08 KB | Source Code | 0 0
  1. <!DOCTYPE html>
  2. <html xmlns:th="http://www.thymeleaf.org">
  3. <head>
  4.     <meta charset="UTF-8">
  5.     <title>Formulario de Materia</title>
  6.     <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css">
  7. </head>
  8. <body class="container mt-5">
  9.     <h2 th:text="${materia.id != null} ? 'Editar Materia' : 'Nueva Materia'"></h2>
  10.    
  11.     <form th:action="@{/subjectNew}" th:object="${materia}" method="post">
  12.         <input type="hidden" th:field="*{id}" />
  13.        
  14.         <div class="mb-3">
  15.             <label for="materia" class="form-label">Nombre</label>
  16.             <input type="text" th:field="*{materia}" class="form-control" required>
  17.         </div>
  18.        
  19.         <div class="mb-3">
  20.             <label for="descripcion" class="form-label">Código</label>
  21.             <input type="text" th:field="*{descripcion}" class="form-control" required>
  22.         </div>
  23.        
  24.         <button type="submit" class="btn btn-primary">Guardar</button>
  25.         <a href="/subject" class="btn btn-secondary">Cancelar</a>
  26.     </form>
  27. </body>
  28. </html>
Tags: html
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement