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

85
Visualizações
Submit Button didn't do anything

Here I'm trying to make a QnA website. So here is the HTML code.

<!DOCTYPE html>
<html>

<head>
  <title>Questions</title>
</head>

<body>
  <h1>Questions</h1>
  <form action="questions.php" method="post" onsubmit='event.preventDefault() ;sendForm1("ask-question")' name="ask-question">
    <h3>Ask a Question</h3>
    <!--Adds textarea field to write a question-->
    <textarea name="ask-question" rows=5 cols=25 id="your-question">Why do you want to draw art?</textarea><br>
    <!--Submit button to send question to email and redirects to result.html without opening an email inbox. The problem is I have no idea how to make it send to my email.-->
    <input type=submit value=Ask name=ask>
  </form>
  <a href="/">Go back home</a>
  <br>
  <p>No Questions available yet!</p>
  <h2>Be the First to ask!</h2>
  <h3>Type the question in the text box then click Ask</h3><a href="faq.html">or go to FAQ</a>
</body>

</html>

Here i put some meanings about the code and you'll find out most problems but the main problem is I can't get the Submit button to work. Or some it just reloads the website. Here is the preview of the code. Click to view Code html Preview How can I fix this?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

The code isn't working because you are using onsubmit = event.preventDefault() which prevents the default behaviour of form submission. That's why you are not getting redirected to the result.html page. Remove the event.preventDefault() and this should be working

about 4 years ago · Juan Pablo Isaza 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