Just an FYI, this took me a bit of trial and error. The form ID is the numerical part of the id attribute on the <form> tag.
example: mktoForm_1101 - the ID is 1101
So this:
var form = MktoForms2.getForm(update with form id);
Would become this:
var form = MktoForms2.getForm('1101');