Home > Net >  How to clear field when submitting form
How to clear field when submitting form

Time:08-27

I'm using <iframe name="votar" style="display:none;"></iframe> To submit the form without without redirecting the tab, but the "Type something..." field is not is not displayed again when submitted.
The submit button is <button > submit </button>
And I already tried with <button type="reset"> submit </button>
What clears the field but does not submit the form
I also got the idea to put a link when pressed to send.
The page reloads the field comes back empty but the form is not submitted, doing so
<a href="http://www.pseudo.link"><button >submit</button></a>
Also tried using <meta http-equiv="refresh" content="5; url=http://www.pseudo.link">
what made the page at a given second refresh all the time
here is the actual page link if you can see the source, it's tiny.
https://friedaum.cf/

<div >
  <div  style="background-image: url('images/bg-01.jpg');">
    <div >
      <iframe name="votar" style="display:none;"></iframe>
      <form action="https://docs.google.com/forms/d/e/.../formResponse" target="votar">
        <span >Make a comment.</span>
        <div  data-validate="Username is reauired">
          <input  type="text" name="entry.???" placeholder="Type something...">
        </div>
        <div >
          <div >
            <div ></div>
            <button >submit</button>
          </div>
        </div>
      </form>
    </div>
  </div>
</div>

CodePudding user response:

I have not been able to see your submit function. So if you have it then add .reset()

If you dint understand what I'm saying then do share your code.

CodePudding user response:

You need to add a script.js file or javascript code into your file where you have to write code to submit the form. And there write submit function with .reset() property and don't prevent the default form action in that code

  •  Tags:  
  • html
  • Related