Long story short, I am working within a framework that automatically calls a function named `[formname]_success()` upon a successful form submission. Normally the form is built server side and the form and success function both sit in the page source.

In this case, however, I am dynamically creating (and naming) a form client side, however I do not know how to dynamically add a function named `[formname]_success()` that can then be called immediately after a successful submission. Right now the code checks to see if `[formname]_success()` exists, sees that it does not and therefore does not attempt to call it.

Is it possible to dynamically write a js function to the HTML document such that it can be called immediately afterwards?

I am familiar with variable function names and how they work, but I don't think it applies here.

I am not in a position where I can change the nature of the success function call from the framework.

Thanks!