I can not use validator.min.js in the pug engine

0

I want to use the functions of the validatorjs in the pug engine, however I can not use it, my file validator.min.js is ./public/javascript, here is my code in the pug:

 html
  head
    title= message
    script(src="./public/javascript/validator.min.js")
    script.
      function validar(){
        const descricao = formulario.descricao.value;
        if(descricao==""){
          alert("Campo descrição vazio!")
          return false
        }
      }

  body
    h1= message
    form(method ="post", action="/cadastrar/carroceria", id="formulario", onsubmit="return validar();")
      input(type="text", name="descricao")
      input(type="submit", value="save")
    
asked by anonymous 20.08.2018 / 15:05

0 answers