Permalink
Browse files

Merge pull request #14 from noinput/master

Multiple selection fix
  • Loading branch information...
2 parents a901a1b + d46d218 commit a780f9292e6704bf1076b273b00b4b05e0a1c98d @viveleroi committed Jan 18, 2013
Showing with 2 additions and 2 deletions.
  1. +1 −1 Formbuilder/Formbuilder.php
  2. +1 −1 js/jquery.formbuilder.js
@@ -409,7 +409,7 @@ protected function loadSelectBox($field){
}
$field['values'] = (array)$field['values'];
if(isset($field['values']) && is_array($field['values'])){
- $multiple = $field['multiple'] == "true" ? ' multiple="multiple"' : '';
+ $multiple = $field['multiple'] == "true" || $field['multiple'] == "checked" ? ' multiple="multiple"' : '';
$html .= sprintf('<select name="%s" id="%s"%s>' . "\n", $this->elemId($field['title']), $this->elemId($field['title']), $multiple);
if($field['required']){ $html .= '<option value="">Selection Required</label>'; }
@@ -256,7 +256,7 @@
var title = '';
if (typeof (options) === 'object') {
title = options[0];
- multiple = options[1] === 'true' ? true : false;
+ multiple = options[1] === 'true' || options[1] === 'checked' ? true : false;
}
field += '<div class="opt_group">';
field += '<div class="frm-fld"><label>' + opts.messages.title + '</label>';

0 comments on commit a780f92

Please sign in to comment.