-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsimpleExample.js
More file actions
22 lines (22 loc) · 836 Bytes
/
Copy pathsimpleExample.js
File metadata and controls
22 lines (22 loc) · 836 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
$(function() {
$("#populate").click(function() {
$("#origForm").objToFields({quote:"We work, yay!"});
return false;
});
$("#populateAndClear").click(function() {
$("#origForm").objToFields({quote:"We work, yay!"}, true);
return false;
});
$("#copy").click(function() {
$("#otherForm").objToFields($("#origForm").fieldsToObj(), true);
console.log("form obj");
console.log($("#origForm").fieldsToObj());
console.log("form obj ignoring nulls");
console.log($("#origForm").fieldsToObj(null, null, true));
console.log("flattened form obj");
console.log($.flattenObject($("#origForm").fieldsToObj()));
console.log("flattened form obj w/ nullAsEmptyString");
console.log($.flattenObject($("#origForm").fieldsToObj(), null, null, true));
return false;
});
});//(jQuery);