We have a single page app that pre-loads records for editing within a Cognito form. The form is populated by passing in values with an entry object.
How can we clear the previously loaded Cognito form and send it a new entry object, without reloading the page?
The following JQuery removes the prior form.
$(".cognito").html("");
We then call the form init again:
var formID = 1;
var entryObj = {"Name": { "First": "Ima", "Last": "Nexta" }};
Cognito.load("forms", { id: formID, entry: entryObj });
But a new form is not rendered.
Only the form's title, description and Submit button appear.