Clear all fields in ASP.net form

前端 未结 7 925
忘掉有多难
忘掉有多难 2020-12-13 20:20

Is there an easy way to reset all the fields in a form?

I have around 100 controls in my asp.net form and there are submit and reset buttons.

How do I make a

7条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-13 21:06

    You can make use of OnClientClick event. This will reset all all the control present on the form. OnClientClick="this.form.reset();return false;"

    See the Code :

    
    

提交回复
热议问题