Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

232
Views
How can put a message of submitted form after a onclick button?

I just need a pop up or a message saying 'thank you for submiting', but the onclick button to confirm is making that hard to do it

<div class="container">
  <form action="https://webto.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8" method="POST" onsubmit="Obrigada">
    <input type="hidden" name="oid" value="00D200000005V5n">
    <input type="hidden" name="retURL" value="O email foi enviado com sucesso">
    <input type="hidden" name="00N20000002ePlc" value="eAccounting">
    <input type="hidden" name="lead_source" value="Other">
    <input type="hidden" name="Lead_Origin__c" value="Other">
    <input type="hidden" name="Nome_Origem_Lista__c" value="http://doc.saphety.com/site/files/mktdepot/Forms/pt/Form_Petapilot.html">
            
            
<div>
  <label for="last_name">*Nome do Utilizador:<span class="required">&nbsp;</span></label>
  <textarea id="last_name" name="last_name" class="inputField" required></textarea>
</div>


<div>
  <label for="email">*E-Mail: <span class="required">&nbsp;</span></label>
  <input  id="email" maxlength="80" name="email" size="20" type="email" pattern="[a-z0-9._%+-]+@[a-z0-9.-]+.[a-z]{2,63}$" /><br>

</div>

<div>
  <label for="Password__c">*Password:<span class="required">&nbsp;</span></label>
  <textarea id="Password__c" name="Password__c" class="inputField" required></textarea>
</div>

<div>
  <label for="Agent__c">*Responsável pelo pedido:<span class="required">&nbsp;</span></label>
  <textarea id="Agent__c" name="Agent__c" class="inputField" required></textarea>
</div>

<div>
  <label for="description">Descrição:<span class="">&nbsp;</span></label>
  <textarea id="description" name="description" class="inputField"></textarea>
</div>
        
            
<p></p>

<div class="divActions">
  <span onclick="Alertasubmissao();">
    </span>     
  <input type="submit" name="submit" value="ENVIAR" onclick="return confirm('Tem a certeza que deseja enviar os dados ao cliente?');">

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

You haven't written it in Javascript code and it's pretty difficult and gets your code messy if you trying to do it within HTML. It's better to make another file which is called for example: submitting.js and refer to it when clicked on the button.

<input type="submit" name="submit" value="ENVIAR" onclick="submitting.js">

In the submitting.js you should include the alert function of 'Javascript'. For example like this:

<script type="text/javascript">
    alert("You have clicked the button!");
</script>
about 4 years ago · Juan Pablo Isaza Report

0

i hope this will help you, you need to move your confirmation and alert into a single function and call it when the form is submitted

if the user hit no to confirm Dialogue the form submission will be cancelled and if user hit confirm the form will be submitted and out thank you alert will be displayed.

document.querySelector('form').onsubmit = (e)=>{
 
  let okToSubmit = confirm('Tem a certeza que deseja enviar os dados ao cliente?');
  
  if(!okToSubmit) return false
  document.querySelector('.alert').innerText = "Thank you for submitting";
  return true;
  
}
<form action="/" method="post">
  <input type="text" name="name">
  <input type="submit"/>
</form>
<div class="alert"></div>

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!