Form Action Loader Self Resource
Form Action Resource
This resource is used to interact with the resources of the form action.
Methods
Parameters
Returns the parameters of the form action.
Examples
const firstParameter = __nylaResources.self.parameters[0];
const secondParameter = __nylaResources.self.parameters[1];
Form
Returns the form HTML element associated with the form action.
Examples
const { email } = __nylaResources.self.form.elements;
const { value } = email;
OnError
Returns the error message of the form action. This error will be displayed to the user if Form Error Content Item is used within the Form.
Arguments
error
string
(required)
Argument example
"Your email is invalid. Please try again."
Examples
__nylaResources.self.onError('Your email is invalid. Please try again.')
OnSuccess
Tells the form action that the form submission was successful. This will trigger the Return Action configured in the Form Content Item.
Examples
__nylaResources.self.onSuccess()