Load a jsp page every 20 secs after 1st page load

I am trying to autosubmit a form upon 1st load and then refresh every 20 secs. I have tried below but it keeps loading the page all the time. is that correct implementation or how I can achieve that.

    var auto = setTimeout(function(){ submitform(); }, 100);

    function submitform(){

    function autoRefresh(){
       auto = setTimeout(function(){ autoRefresh(); }, 20000);