Can you perform a reset when accessing the page?

Asked

Viewed 153 times

0

I wonder if you have a way to execute <input type="reset"> when a page is accessed, without having to click any button!

  • http://answall.com/q/22677/?

  • @bfavaretto had already seen it this way, but it did not have the result I expected!

  • No? And what was the result?

2 answers

1

You will have to use js or jquery, there are several ways to do this.

$(function() {
   $('#id_do_form')[0].reset();
   //ou
   $('#id_do_form').trigger("reset");
});

There are several other means.

0

You can try using the function window onload. to do this.

JS

window.onload = function (){
  document.getElementById("FormId").reset();
}

Jquery

$( document ).ready(function() {
    $('#FormId').reset();
});

Browser other questions tagged

You are not signed in. Login or sign up in order to post.