Demo Form

Run a Button on Form Open

Overview

This is a small technique to show how to run (click) a button automatically on form open. This was needed when I built a simple hit counter with an Action Form. The form runs some procedures to log when a user visits a page. I wanted to record the Device Fingerprint too but that is only available on form submit not on form init, which was where the actions had been placed. So now on init, this JQuery script calls the button click after a slight delay for the form to load. The button gets and records the Device Fingerprint.

 

Setup Instructions

1. Add the following JS in the form header, init section to pause a short time and then call the click event of the button by name.


setTimeout(function (){
document.getElementById("dnn641Save").click();
  }, 500);

return false;

2. Add a button named "Save" and configure it to do whatever is needed, like recording the Device Fingerprint

Mark Buelsing

Contributions List

Community Comments, Feedback and Refinements

Any constructive comment is welcome.

See and Add Comments Here