开发者

Clear all fields after record inserted in asp.net

开发者 https://www.devze.com 2023-01-14 01:42 出处:网络
I have a small form of 4 fields, I am using Ajax to save record and give alert to user on same page. all is working fine but I want to clear all 4 fields after record is inserted and don\'t want user

I have a small form of 4 fields, I am using Ajax to save record and give alert to user on same page. all is working fine but I want to clear all 4 fields after record is inserted and don't want user to press again and duplicate,

Right now I am using

开发者_运维技巧this._studentName.text = "";

but is there any easy method to get same result coz I have another form where there are more then 40 fields and don't want write .text = "" 40 times


If you use jQuery then you could write:

$('#formID input[type=text]').val('');

If you don't use jQuery then you could still call this.getElementsByTagName('input') and loop through the results to clear the values.


If it's applicable, Why not redirect to the same page? :)

0

精彩评论

暂无评论...
验证码 换一张
取 消