Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7864593
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T23:49:57+00:00 2026-06-02T23:49:57+00:00

After clicking an html reset button, <input type=reset /> I would like to execute

  • 0

After clicking an html reset button,

<input type="reset" />

I would like to execute some code. How can I do this and ensure that the form was reset prior to doing so?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T23:49:58+00:00Added an answer on June 2, 2026 at 11:49 pm

    Using a setTimeout as Ben does here is best: https://stackoverflow.com/a/21641295/144665

    $("input[type='text']").val('Hello Everybody!');
    
    $("input[type='reset']").closest('form').on('reset', function(event) {
    
      // executes before the form has been reset
      console.log('before reset: ' + $("input[type='text']").val());
    
      setTimeout(function() {
        // executes after the form has been reset
        console.log('after reset: ' + $("input[type='text']").val());
      }, 1);
    
    });
    

    You might want to narrow that form selector down to the specific form involved, maybe with an id.

    Fiddle Proof: http://jsfiddle.net/iambriansreed/Zh5cd/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

how can i do. i have many html elements on page. after clicking on
I have some elements like <a class='link'>click</a> which are created after clicking on another
In my html i have got div with given class. After clicking a button
In the below code TextBox value is not getting cleared after clicking on Button.
My HTML <div> <span class=more-available data-completeMessage=This is the complete message you see after clicking
I have this textarea (it's expaned, after clicking on a specific button) which is
I have an updatepanel which after clicking one button is submitting the page. The
How do I get to increment a textbox content after clicking on a button?
My problem is that the file is empty after clicking stop button but only
A very peculiar bug in a simple html form. After changing an option, button

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.