serialize

From Genesys Documentation
Revision as of 12:00, July 15, 2020 by WikiSysop (talk | contribs) (Text replacement - "\|Platforms?=([^\|]*)PureCloud([\|]*)" to "|Platform=$1GenesysCloud$2")
Jump to: navigation, search
This topic is part of the manual Journey JavaScript SDK for version Current of Genesys Predictive Engagement.

Contents

Learn how to use the serialize method to submit serialized data from a form.

serialize

The serialize method creates a JSON object where the keys are the form elements names, and the value for each key is the value(s) of the corresponding form elements. This method is useful in scenarios such as submitting a form with AJAX, since submit won’t be able to capture the form submission, but instead a record can be invoked passing the serialized form data as its last argument. The serialize method takes the following parameters:

  • A unique identifier of the HTML form element
  • An (optional) array with the names of the elements to be serialized
  • A callback function with the serialized form data into a JSON object
ac('serialize', 'my-form', function(data) {
  console.log(data['contact-email']);
});
Retrieved from "https://all.docs.genesys.com/ATC/Current/SDK/serialize (2025-06-23 18:08:58)"
Comments or questions about this documentation? Contact us for support!