diff --git a/core/js/oc-dialogs.js b/core/js/oc-dialogs.js index 2467af61121..28dec97fd30 100644 --- a/core/js/oc-dialogs.js +++ b/core/js/oc-dialogs.js @@ -66,39 +66,42 @@ var OCdialogs = { /** * prompt user for input with custom form * fields should be passed in following format: [{text:'prompt text', name:'return name', type:'input type', value: 'dafault value'},...] + * select example var fields=[{text:'Test', name:'test', type:'select', options:[{text:'hallo',value:1},{text:'hallo1',value:2}] }]; * @param fields to display * @param title dialog title * @param callback which will be triggered when user press OK (user answers will be passed to callback in following format: [{name:'return name', value: 'user value'},...]) */ form:function(fields, title, callback, modal) { var content = '
'+fields[a].text+' | '; - var type=fields[a].type; + $.each(fields, function(index, val){ + content += ' |
'+val.text+' | '; + var type=val.type; + if (type == 'text' || type == 'checkbox' || type == 'password') { - content += ''; } else { content += '>'; } - } else if (type == 'text' || type == 'password' && fields[a].value) { - content += ' value="'+fields[a].value+'">'; + } else if (type == 'text' || type == 'password' && val.value) { + content += ' value="'+val.value+'">'; } } else if (type == 'select') { - content += ''; } content += ' |