We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 092fa60 commit f9c82ebCopy full SHA for f9c82eb
test/test.js
@@ -65,6 +65,26 @@ describe('form', function() {
65
}
66
});
67
68
+ it('formToArray: json object', function() {
69
+ var a = $('#form1').formToArray();
70
+ var o = $.fn.formArrayToJsonData(a);
71
+ // console.log(JSON.stringify(o,0,4));
72
+ assert.strictEqual(o.constructor, Object, 'type check');
73
+ assert.deepEqual(o, {
74
+ "Hidden": "hiddenValue",
75
+ "Name": "MyName1",
76
+ "Password": "",
77
+ "Multiple": "six",
78
+ "Single": "one",
79
+ "Single2": "A",
80
+ "Check": "2",
81
+ "Radio": "2",
82
+ "action": "1",
83
+ "method": "2",
84
+ "Text": "This is Form1"
85
+ });
86
87
+
88
it('formToArray: text promotion for missing value attributes', function() {
89
var expected = [
90
{ name: 'A', value: ''},
0 commit comments