Help - Uncaught Error: Syntax error, unrecognized Expression: #[Object Htmlformelement]

Asked

Viewed 609 times

1

inserir a descrição da imagem aquierro no console

Problem in validating a form with ajax, follow the error..

$.ajax({
    type: "POST",
    url: "adicionaConcorrente",
    cache: false,
    data: $("#" + varForm).serialize(),
    beforeSend: function() {
        // Faz alguma coisa antes de enviar
    },
    success: function(result) {
        $("#" + id).html("");
        $("#" + id).html(result);
        $('#idDoModal').modal('show');
    },
    complete: function() {
        // Faz alguma coisa depois que terminar
    }
});
  • You have to put the code you are using in order to help more. For example, what this added function looks like?

  • 1

    Will the url be okay? It’s just adicionaconcorrente?

  • yes add Current?+ parameters

  • 1

    Do not miss the parameters? and will not be qql thing like http://www.meusite.com/adicionaconcorrente.php?param1=123&param2=123?

  • it would take the function, where: date: $("#" + varForm). serialize(),

  • Young man, the mistake could probably be on the line data: $("#" + varForm).serialize(), what the value of this varForm ? plays on the console the value and checks nomavente

  • correct, the error is in $("#" + varForm). serialize(): correction: ("#varForm"). serialize():

Show 2 more comments
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.