Please note, this is a STATIC archive of website developer.mozilla.org from November 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

TPS Formdata Lists

A Formdata asset list is an array of objects, each with the following properties:

  • fieldname: required.
  • value: required.
  • date: the date the form data was used, expressed in hours from the present, so 0 means now, and -24 means 24 hours ago. Optional, defaults to 0.

For example:

var formdata1 = [
  { fieldname: "testing",
    value: "success",
    date: -1
  },
  { fieldname: "testing",
    value: "failure",
    date: -2
  },
  { fieldname: "username",
    value: "joe"
  }
];

Formdata lists and phase actions

You can use the following functions in phase actions for formdata lists:

  • Formdata.add
  • Formdata.delete
  • Formdata.verify
  • Formdata.verifyNot

For an example, see the TPS formdata unittest:  https://hg.mozilla.org/services/tps/f...st_formdata.js

Notes

Note 1, TPS supports the delete action for Formdata, but Sync currently does not correctly sync deleted form data, see bug 564296.

Note 2, Sync currently does not sync Formdata dates, so the date field is ignored when performing verify and verify-not actions. See bug 552531.

Document Tags and Contributors

Tags: 
 Last updated by: teoli,