Mike521w So this is what I came up with: The JS contains everything you need to interact with the module. You no longer need to make any modification or entries to the pages themselves. There is a small section at the top of the JS that defines your settings. Settings are API endpoint, site key, and desired action watch list that can either be every default action OR just the same actions that you define in the module. The JS loads the API into memory on page load. Then it scans the page for those Miva hidden action value = "LOGN" (or which ever) inputs that are in the forms. It compares what it finds on the page to the list of monitored actions placed at the top of the JS file. It then creates the hidden input entry for the token that would normally be manually entered into the HTML. Then it attaches an event to the submit action of the form, interrupts the default submit, sends and waits for the token, and then programmatically "submits" the form.
When you add the JS to the Miva resources, you have to enable it for every page you want the JS to run on. I guess you could leave it global, but I chose not to. You also need to select the Resource Group for the JS to be in the head_tag.
Seems to work well so far!
When you add the JS to the Miva resources, you have to enable it for every page you want the JS to run on. I guess you could leave it global, but I chose not to. You also need to select the Resource Group for the JS to be in the head_tag.
Seems to work well so far!
Comment