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

133
Visualizações
How to submit form while event.preventDefault() is applied

I know it might be a duplicate of another question but I think my case is a little different than others.

I have a page that contains a form for logout that is sending POST request to an endpoint and a form for live search from the database through AJAX call. On document load the page is running the function for showing results from the database which has event.preventDefault() in it which is stopping the form submission. The issue is that I can't send the logout form now. This is how my logout form looks

<a href="javascript:void(0);" onclick="event.preventDefault();$(this).children('form').submit();">
    <form method="POST" action="{{ route('logout') }}">
        @csrf
        <span>@lang('main.navigation_logout')</span>
    </form>
</a>

This logout form is not working only on the page with the live search (Because of the event.preventDefault() in the live search function). How can I allow this logout form submission?

about 4 years ago · Santiago Trujillo
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