Automatically submitting a form.
I am working on a JSF page that I want to automatically submit without any input from the user. However, I can't figure out how to make it auto submit. I currently have a javascript that just presses a form button to submit...
document.getElementById("mainForm:submitButton").click();
However, it never clicks the button. If I run the following line...
document.getElementById("mainForm").submit();
The form will submit, but I will not be able to execute the logic I want from the pagecode.

