From Genesys Documentation
m (Text replacement - "\|Platform=([^\|]*)GenesysEngage-onpremises([\|]*)" to "|Platform=$1GenesysEngage-cloud$2") |
(Published) |
||
Line 6: | Line 6: | ||
|Dimension=UtilityMethods | |Dimension=UtilityMethods | ||
|ComingSoon=No | |ComingSoon=No | ||
− | |Platform=GenesysEngage-cloud | + | |Platform=PureConnect, GenesysCloud, GenesysEngage-cloud |
− | |||
|Section={{Section | |Section={{Section | ||
|sectionHeading=serialize | |sectionHeading=serialize | ||
− | |||
|alignment=Vertical | |alignment=Vertical | ||
− | + | |structuredtext=The <tt>serialize</tt> 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 cannot capture the form submission. Instead a record can be invoked passing the serialized form data as its last argument. The serialize method takes the following parameters: | |
− | |||
− | |structuredtext=The <tt>serialize</tt> 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 | ||
*A unique identifier of the HTML form element | *A unique identifier of the HTML form element | ||
− | *An (optional) array with the names of the elements to | + | *An (optional) array with the names of the elements to serialize |
*A callback function with the serialized form data into a JSON object | *A callback function with the serialized form data into a JSON object | ||
Line 25: | Line 21: | ||
}); | }); | ||
</source> | </source> | ||
− | |||
− | |||
|Status=No | |Status=No | ||
}} | }} | ||
}} | }} |
Revision as of 19:05, December 16, 2020
Difference between revisions of "ATC/Current/SDK/serialize"
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 cannot capture the form submission. 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 serialize
- A callback function with the serialized form data into a JSON object
ac('serialize', 'my-form', function(data) {
console.log(data['contact-email']);
});
Comments or questions about this documentation? Contact us for support!