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
  • 16,861
  • 21
  • 61
  • 85

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
  • 333,516
  • 69
  • 632
  • 626
-1

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

iburlakov
  • 4,098
  • 7
  • 37
  • 40