views:

1115

answers:

3
A: 

Shouldn't cancel take you away from the form entry page? It sounds like you are trying to code "reset", but you are functionally attempting "cancel".

Personally, I always have an event that fires on "cleanup" and does all form cleanup that I need to do (not just for reset form fields).

pearcewg
+1  A: 

Try this:

  cmdCancel.Attributes.Add("onClick","document.getElementById('" + this.Page.ClientId + "').reset(); return false;");
FlySwat
+1  A: 

A call to "Reset" on a form resets the values to what was supplied in the markup for the page. So if there are any values supplied (via ViewState or any other mechanism) that is what the fields will be reset to, not blank.

Sean Carpenter