This repository has been archived by the owner on Jan 4, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 27
Adding Initial Values
Justin Stayton edited this page Aug 29, 2013
·
6 revisions
There are three ways to add initial values to an instance of Manifest.
If you're working with simple string values (as opposed to more complex values in JSON format), the initial values can be set as the value
of the input field. Each value is split on the configured separator
characters (by default, a comma) and trimmed. For example:
<input type="text" name="tags" id="tags" value="Baseball, Football, Running">
In this example, Baseball, Football, and Running are added to the list.
For more complex data in JSON format, an object or array of objects can be stored in the input field's data-values
attribute:
<input type="text" name="recipients" id="recipients" data-values="{ "name": "Lindsay Weir", "email": "[email protected]" }">
Important: Be sure to properly encode the string of JSON!
The third and final method is to specify the initial values in the values
option:
$('#recipients').manifest({
values: {
name: 'Lindsay Weir',
email: '[email protected]'
}
});