diff --git a/examples/forms/form_elements/js/example.js b/examples/forms/form_elements/js/example.js index 4ec1bbb8..d823f7eb 100644 --- a/examples/forms/form_elements/js/example.js +++ b/examples/forms/form_elements/js/example.js @@ -24,6 +24,46 @@ Ox.load({Geo: {}, UI: {}, Unicode: {}}, function() { label: 'Please enter up to 3 names', max: 3, width: 256 + }, + { + description: 'Custom array input with label', + input: { + get: function() { + var $input = Ox.FormElementGroup({ + elements: [ + Ox.Select({ + items: [ + {id: 'home', title: 'Home'}, + {id: 'work', title: 'Work'}, + {id: 'mobile', title: 'Mobile'} + ], + overlap: 'right', + width: 80 + }) + .bindEvent({ + change: function() { + $input.options('elements')[1] + .focusInput(); + } + }), + Ox.Input({ + autovalidate: /[\d\s\.+\-\/]/, + width: 128 + }) + ] + }); + return $input + }, + getEmpty: function() { + return ['home', '']; + }, + isEmpty: function(value) { + return value[1] === ''; + } + }, + label: 'Please enter up to 3 phone numbers', + max: 3, + width: 256 } ] },