Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

181
Visualizações
Form Submission returns 'Undefined' pop up

I have a form I try to submit that can potentially have a lot of data and some users get a simple alert 'Undefined' when trying to submit. I've tried to replicate the issue on my local machine, on our test server and in production and I have no issues with all 3 environments.

I receive no error logs from our logging which leads me to think that it is an issue in the browser or front end since I would probably get a log message if it reached the backend.

...
<form id="WorkplaceIncidentForm" class="incidentReport text-center">
...
<button type="button" class="btn btn-info btn-lg" onclick="SendForm()">Submit</button>
...

function SendForm() {
   var form = $("#WorkplaceIncidentForm").serialize();
        var message = checkInputs();

        if (message === "valid") {
            $.ajax({
                type: "POST",
                url: "@Url.Action("Submit","Form")",
                data: form,
                dataType: 'json'
            })
                .fail(function (result) {
                    alert(result.message);
                })
                .done(function (result) {
                    if (result.success) {
                        alert('Successfully submitted!')
                        window.location.href = '../Form/ReportSubmitted';
                    }
                    else {
                        alert(result.message);
                    }
                });
        }
        else {
            alert('Please fill in ' + message + ' field.');
        }
}
about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda