foundation.form.response.parser: is a response parser of foundation-form.

It is designed to parse Sling’s HTMLResponse.class.

Matching Condition

The response HTML MUST have an element with #Status selector.

Parsed Data

It returns a JS object which properties are based on the elements having id attribute. The value of id attribute is used as the key of the property, while the value of the element is used as the value of the property.


Given the response HTML:

      <!-- ... -->
      <td><div id="Status">200</div></td>
      <td><div id="Message">Site created</div></td>
      <td><a href="/content/geometrixx5" id="Location">/content/geometrixx5</a></td>
      <td><div id="Path">/content/geometrixx5</div></td>
      <!-- ... -->

The parsed data is the following object:

var parsedData = {
   Status: "200",
   Message: "Site created",
   Location: "/content/geometrixx5",
   Path: "/content/geometrixx5"