1

I need to reset an ASP.NET form. I am trying to use document.aspnetForm.reset() but then whenever I try to do anything after that I get an event validation error. How can I reset my form without upsetting ASP.NET's Event Validation? I CANNOT turn off event validation. Thanks!

Ryan
  • 17,511
  • 23
  • 63
  • 88

2 Answers2

1

You will need to clear each form element manually. If you have jQuery you could retrieve all input[@type="text"] and set their value to "" and so on for other form elements...

Andrew Hare
  • 344,730
  • 71
  • 640
  • 635
-1

Add return false; to you javascript code. It will prevent postback.

iburlakov
  • 4,164
  • 7
  • 38
  • 40