Skip to content

Instantly share code, notes, and snippets.

Created September 4, 2019 21:05
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save parzibyte/920c5a9e11e42ff42db5dfdccfc7fc47 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html lang="es" xmlns:th=""
<main layout:fragment="contenido">
<div class="col-12">
<h2>Editar producto </h2>
<form th:object="${producto}" th:action="@{/productos/editar/} + ${}" method="post">
<input type="hidden" th:field="*{id}">
<div class="form-group">
<label for="nombre">Nombre del producto</label>
<input autocomplete="off" autofocus th:field="*{nombre}" id="nombre"
placeholder="Escribe el nombre del producto" type="text"
class="form-control" th:classappend="${#fields.hasErrors('nombre')} ? 'is-invalid' : ''">
<div class="invalid-feedback" th:errors="*{nombre}"></div>
<div class="form-group">
<label for="codigo">Código de barras</label>
<input autocomplete="off" th:field="*{codigo}" id="codigo" placeholder="Escribe el código del producto"
class="form-control" th:classappend="${#fields.hasErrors('codigo')} ? 'is-invalid' : ''">
<div class="invalid-feedback" th:errors="*{codigo}"></div>
<div class="form-group">
<label for="existencia">Existencia actual</label>
<input autocomplete="off" th:field="*{existencia}" id="existencia"
placeholder="Cantidad actual del producto" type="number"
class="form-control" th:classappend="${#fields.hasErrors('existencia')} ? 'is-invalid' : ''">
<div class="invalid-feedback" th:errors="*{existencia}"></div>
<div class="form-group">
<label for="existencia">Precio</label>
<input autocomplete="off" th:field="*{precio}" id="precio" placeholder="Precio del producto"
class="form-control" th:classappend="${#fields.hasErrors('precio')} ? 'is-invalid' : ''">
<div class="invalid-feedback" th:errors="*{precio}"></div>
<button class="btn btn-success" type="submit">Guardar</button>
&nbsp;<a class="btn btn-warning" th:href="@{/productos/mostrar}">Ver todos</a>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment