jQuery Form Fill Plugin
Overview
The"jQuery Form Fill" fills forms from JSON objects.
-
Fills all kinds of html elements:
- text
- password
- hidden
- textarea
- checkbox
- radio
- select
-
Fills fields with jQueryUI Datepicker.
- Date in string format. Ex: "MM/DD/YYYY"
- Date in milliseconds
Quick Start Guide
Using names of form elements with object syntax ("user.name"):
$("#form1").fill(user);
Using normal names of form elements:
$("#form2").fill(user, {styleElementName:'none'});
JSON used:
user = {
"name" : "Makoto Hashimoto",
"email" : "makoto@makoto.blog.br",
"phone" : {
"codeArea" : "+55",
"number" : "2755555555"
},
"date1": "03/30/1981", // (mm/dd/yyyy)
"date2": "354769200000", // 1981-03-30 in milliseconds
"gender" : "M"
"admin" : "Y",
"rules" : [
{"id" : "1", "name": "Admin"},
{"id" : "3", "name": "Developer"}
]
};
Options:
styleElementName
- 'object' : When the names of form elements looks like objects 'user.name'. (Default)
- 'none' : When the names of form elements are normal
dateFormat
You can inform what date format come from json.
Examples:
- 'mm/dd/yy' : USA date format (Default)
- 'dd/mm/yy' : Brazilian date format
debug
- true : Turn on the debug mode
- false : Turno off the debug mode (Default)
elementsExecuteEvents
You can inform each element type you want execute the methods of events onclick or onchange.
Examples:
- ['checkbox', 'radio', 'select-one'] : Default