0

Is it possible to refresh the page after clearing all the form fields? Is this a separate function or could it be added to my existing script.

function clear_form_elements(ele) {
 $(ele).find(':input').each(function() {
 switch(this.type) {
    case 'password':
    case 'select-multiple':
    case 'select-one':
    case 'text':
    case 'textarea':
        $(this).val('');
        $(this).removeAttr("style");
        break;
    case 'checkbox':
    case 'radio':
        this.checked = false;
}
});

}
braX
  • 11,506
  • 5
  • 20
  • 33
Erik
  • 5,701
  • 27
  • 70
  • 119

1 Answers1

0

I do not know whether this will work really.But you can do this way as well in jquery :

$('#PageRefresh').click(function() {

              location.reload();

    });

this is rather easy and straight forward.

UVM
  • 9,776
  • 6
  • 41
  • 66