Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

submit form automatically javascript

<form name="myForm" id="myForm" target="_myFrame" action="test.php" method="POST">
    <p>
        <input name="test" value="test" />
    </p>
    <p>
        <input type="submit" value="Submit" />
    </p>
</form>

<script type="text/javascript">
    window.onload=function(){
        var auto = setTimeout(function(){ autoRefresh(); }, 100);

        function submitform(){
          alert('test');
          document.forms["myForm"].submit();
        }

        function autoRefresh(){
           clearTimeout(auto);
           auto = setTimeout(function(){ submitform(); autoRefresh(); }, 10000);
        }
    }
</script>
Comment

PREVIOUS NEXT
Code Example
Javascript :: wait javascript 
Javascript :: js check if function exists 
Javascript :: regex for counting characters 
Javascript :: jquery get unique values from array 
Javascript :: string contains javascirpt 
Javascript :: size of call stack js 
Javascript :: hide html element with javascript 
Javascript :: remove duplicates from array of objects javascript 
Javascript :: get element by tag name 
Javascript :: javascript word count 
Javascript :: jQuert latest cdn 
Javascript :: jest-environment-jsdom cannot be found 
Javascript :: get all classes of element jquery 
Javascript :: math.rount 
Javascript :: Get day first 3 letters name js 
Javascript :: chartjs how to disable hover lable 
Javascript :: moment add 6 months 
Javascript :: bootstrap multiselect change value 
Javascript :: padend method javascript 
Javascript :: random number in range js 
Javascript :: js one line if 
Javascript :: lodash get difference between two arrays of objects 
Javascript :: get the value of css properties js 
Javascript :: isempty is not defined 
Javascript :: how to set/get cookie in JavaScript 
Javascript :: how to print line break in javascript 
Javascript :: javascript remove all style values in div 
Javascript :: javascript reload page 
Javascript :: check if a checkbox is checked jquery 
Javascript :: integers to space separated string in javascript 
ADD CONTENT
Topic
Content
Source link
Name
4+8 =