$.fn.clearForm = function() {
return this.each(function() {
var type = this.type, tag = this.tagName.toLowerCase();
if (tag == 'form') {
$('td.status', this).empty();
return $(':input', this).clearForm();
}
if (type == 'text' || type == 'password' || tag == 'textarea' || tag ==
'label')
this.value = '';
else if (type == 'checkbox' )
this.checked = false;
else if (tag == 'select')
this.selectedIndex = -1;
});
};
and just call this as,
function clearaddform() {
$("#aspnetForm").clearForm();
}
and now you can just call clearaddform function from your button.
Pretty part of content. I just stumbled upon your site and in accession capital
ReplyDeleteto claim that I acquire in fact loved account your weblog
posts. Any way I will be subscribing for your feeds or even I fulfillment you get right of entry to persistently rapidly.
Here is my homepage; Male enhancement
You’ve performed an excellent job.am waiting for your next blog. SEO Expert in Pakistan
ReplyDelete