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
  • 10,905
  • 5
  • 18
  • 32
Erik
  • 5,533
  • 26
  • 67
  • 113

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,725
  • 5
  • 40
  • 64