App.py corrigido

parent bd176c04
...@@ -18,40 +18,38 @@ ...@@ -18,40 +18,38 @@
<a href="/" class="btn btn-primary">Voltar</a> <a href="/" class="btn btn-primary">Voltar</a>
</div> </div>
<form id="formCadastro"> <form id="formCadastro" action="{{ url_for('cadastro') }}" method="post">
<input type="text" id="nome" placeholder="Digite o nome" required><br> <input type="text" id="nome" name="nome" placeholder="Digite o nome" required><br>
<input type="text" id="porcoes" placeholder="Porções" required><br> <input type="text" id="porcoes" name="porcoes" placeholder="Porções" required><br>
<input type="text" id="tempo" placeholder="Tempo de preparo" required><br> <input type="text" id="tempo" name="tempo" placeholder="Tempo de preparo" required><br>
<textarea id="descricao" placeholder="Descrição da receita" required></textarea><br> <textarea id="descricao" name="descricao" placeholder="Descrição da receita" required></textarea><br>
<input type="text" id="ad_ingrediente" placeholder="Ingrediente"> <input type="text" id="ad_ingrediente" placeholder="Ingrediente">
<button onclick="adicionar()">Adicionar</button> <button type="button" onclick="adicionar()">Adicionar</button>
<br><br> <br><br>
<textarea id="ingredientes" rows="10" cols="30" readonly></textarea><br> <textarea id="ingredientes" name="ingredientes" rows="10" cols="30" readonly required></textarea><br>
<script> <script>
function adicionar() { function adicionar() {
let texto = document.getElementById("ad_ingrediente").value; let texto = document.getElementById("ad_ingrediente").value;
let textarea = document.getElementById("ingredientes"); let textarea = document.getElementById("ingredientes");
if (!texto) return;
textarea.value += "- " + texto + "\n"; textarea.value += "- " + texto + "\n";
document.getElementById("ad_ingrediente").value = ""; document.getElementById("ad_ingrediente").value = "";
} }
</script> </script>
<textarea id="preparo" placeholder="Modo de preparo" required></textarea><br> <textarea id="preparo" name="preparo" placeholder="Modo de preparo" required></textarea><br>
<input type="file" id="imagem" accept="image/*" required><br>
<button type="submit">Cadastrar</button> <input type="submit" value="Cadastrar" class="btn btn-primary"><br>
</form>
<button type="reset">Apagar Dados</button> <button type="reset">Apagar Dados</button>
</form>
<div class="cards" id="lista"></div> <div class="cards" id="lista"></div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment