File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 9494 'input' : {
9595 validation : 'int|empty' ,
9696 errorMsg : 'You need to type a number' ,
97- label : 'Type a number'
97+ label : 'Type a number' ,
98+ // value: '100'
9899 } ,
99100 'dropdown' : {
100101 validation : 'empty' ,
101102 errorMsg : 'You need to select an item' ,
102- label : 'Select an Item'
103+ label : 'Select an Item' ,
104+ // value: 'List Item 4'
103105 } ,
104106 'radio' : {
105107 validation : function ( name , value , data ) {
106108 return data [ name ] === 'Red' && value === 'Red' ;
107109 } ,
108110 errorMsg : 'You need to select \'Red\'' ,
109- label : 'Select a Color'
111+ label : 'Select a Color' ,
112+ // value: 'Red'
110113 }
111114 } ,
112115 // returned from server-side validation(?)
Original file line number Diff line number Diff line change 120120 value = this . data [ key ] . value || null ;
121121
122122 // If there was an initial value set in markup, use that
123- // However, values set in the config will always 'win':
123+ // However, values set in the config will always 'win'
124124 if ( field . value && value === null ) {
125125 value = field . value ;
126126 }
127127
128- // store the field and parent element just in case we need
129- // to reference those later
128+ // Store the field and parent element just in case
129+ // we need to reference those later
130130 this . data [ name ] . field = field ;
131131 this . data [ name ] . parentEle = parentEle ;
132132
133133 this . _updateData ( name , value ) ;
134134 this . _createErrorMsg ( name , parentEle , errorMsg ) ;
135135 this . _createLabel ( name , parentEle , field , label ) ;
136+
137+ // Populate the fields if necessary
138+ if ( ! field . value && value ) {
139+ field . value = value ;
140+ }
136141 }
137142 } ,
138143
You can’t perform that action at this time.
0 commit comments