I am receiving json form when submitting a contact form , and I would like to get the inline message of it ;
xhr.onreadystatechange = function() {
if(xhr.readyState == 4 && xhr.status == 200) {
setFormMessage(xhr.responseText.) // Returns a 200 response if the submission is successful.
} else if (xhr.readyState == 4 && xhr.status == 400){
setFormMessage(xhr.responseTex)); // Returns a 400 error the submission is rejected.
} else if (xhr.readyState == 4 && xhr.status == 403){
setFormMessage(xhr.responseText); // Returns a 403 error if the portal isn't allowed to post submissions.
} else if (xhr.readyState == 4 && xhr.status == 404){
setFormMessage(xhr.responseText); //Returns a 404 error if the formGuid isn't found
}
}
this the message when it's 200 :
{"inlineMessage":"Thanks for submitting the form."}
I have already tried to get the value of the inlineMessage like this :
xhr.responseText.inlineMessage
but it didn't work ! any idea how to get that message