What is Populatr?
Populatr is very simple to use. We can use CSS selectors to target a form (ID, class, etc) and for inputs—including selects—it targets the
name attribute. Take the following form for example:
To populate this form we need to initiate Populatr and then feed in some data:
We initialise Populatr with
Populatr.init() then pass in if it’s active using either
populatr.json would look like:
Note: double quotes are required for JSON.
Defining multiple forms is possible by passing in multiple objects:
Most input types are supported, including newer HTML5 inputs. See the demo for the full range along with an example on populating them.
If you have any thoughts, suggestions or issues, please leave a comment below.