-1
I’m trying to make a script that contains a function in the Pug engine, but I can’t get it called when the user sends the form, can anyone help me? Follows the code:
html
head
title= message
script.
funtion validator(){
alert("teste");
}
body
h1= message
form(method ="post", action="/cadastrar/marca")
input(type="text", name="descricao", id="descricao")
input(type="submit", onclick="return validator()")
What is the HTML generated from this file?
– Woss
<html><head><title>Register Tag</title></head><body><H1>Register Tag</H1><form method="post" action="/register/tag"><input type="text" name="Description"/>input type="Submit" value="save"/></form></body><</html>
– victor_bez
First, correct the term
funtion
that should befunction
.– Woss
I tested your code with https://html2jade.org/ and could not reproduce the problem. I ask you to edit the question and add more details of how you are generating HTML - and make sure you are generating from the correct file.
– Woss