Clearing or Refreshing a Form
⚠️ The annual cost of maintaining the server where this website is hosted, the domain, and keeping it up-to-date is approximately €3,000 per year. Help us with a small donation to cover these expenses. Support Now!
0 / 10000 €
In SFRA, you use the server.getForms
function to get the form data
structure from the relevant form definition and convert it into a JSON object. The object is
then added to the data passed to the template, so that it's available to the template via the
pdict
variable. To clear the form, you must manually call the
clear
method.
Example:
This example gets the profile form and clears it.
function (req, res, next) {
var accountModel = getModel(req);
var profileForm = server.forms.getForm('profile'); //gets the profile form object
profileForm.clear(); //clears the form using a function from the server module forms.js