Hi everyone. I tried to find a solution in order to save/apply changes in my form automatically in certain time intervals. Here's the solution I've found. I added a php plugin to my form and choosed the process script "After the end of the form (getEndContent)". The php custom code I used was as follows:
-------
echo "<script>\n";
echo "function applyclick() {\n";
echo "var x = document.getElementsByClassName(\"btn button\");\n";
echo "var i;\n";
echo "for (i = 0; i < x.length; i++) {\n";
echo " if (x.name == \"apply\") {\n";
echo " x.click();\n";
echo " }\n";
echo "}\n";
echo "}\n";
echo "setInterval(applyclick, 180000);</script>\n";
------
this creates a javascript which identifies the form's apply button and fires its click event every 30 seconds.
the following php code does not work
echo "<script>setInterval(function(){ var x = document.getElementsByName(\"apply\"); x[0].click; }, 3000);</script>\n";
I hope this helps someone.
-------
echo "<script>\n";
echo "function applyclick() {\n";
echo "var x = document.getElementsByClassName(\"btn button\");\n";
echo "var i;\n";
echo "for (i = 0; i < x.length; i++) {\n";
echo " if (x.name == \"apply\") {\n";
echo " x.click();\n";
echo " }\n";
echo "}\n";
echo "}\n";
echo "setInterval(applyclick, 180000);</script>\n";
------
this creates a javascript which identifies the form's apply button and fires its click event every 30 seconds.
the following php code does not work
echo "<script>setInterval(function(){ var x = document.getElementsByName(\"apply\"); x[0].click; }, 3000);</script>\n";
I hope this helps someone.