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

254
Visualizações
Ajax Call on submit handler Jquery Validation

I have a form which have multiple select dropdown name=select[], and this form is validate from Jquery Validation and after successful validation Submit handler call Ajax i want to send all form keys and values also include in array form , Here is My Code .

function:submitHandler
{
$.ajax({
url: "processo.php", 
type: "POST",             
data: new FormData(this),
cache: false,             
processData:false,      
success: function(data)   
{
$('#loading').hide();
$("#message").html(data);
}
});
}

Now the when validation successfully done new FormData(this) not recognize form id.but when i put new Formdata($("#frmRegister")[0]) then its send variables to php but not array. How can i define form id in like new Formdata("#frmRegister").Remember please i also have mulitple select array in form .

about 4 years ago · Santiago Trujillo
2 Respostas
Responde à pergunta

0

The submithandler goes inside of the .validate() method and you would use the form argument provided by the developer.

$('#myform').validate({
    submitHandler: function(form) {
        $.ajax({
            url: "processo.php", 
            type: "POST",             
            data: new FormData($(form)),
            cache: false,             
            processData: false,      
            success: function(data) {
                $('#loading').hide();
                $("#message").html(data);
            }
        });
        return false;
    },
    // other options
});

You could also use $(form).serialize(); instead.

about 4 years ago · Santiago Trujillo Relatório

0

Thank You Very Much For giving Answer i have solution here is code .

function: submitHandler {
            $("#frmRegister").load("submit", function (e)// Trigger Submit When Validation Done
            {
                $.ajax({
                    url: "processo.php",
                    type: "POST",
                    data: new FormData(this),
                    cache: false,
                    processData: false,
                    success: function (data) {
                        $('#loading').hide();
                        $("#message").html(data);
                    }
                });
            });
        }
about 4 years ago · Santiago Trujillo Relatório
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