Skip to content

Commit

Permalink
Fixed errors with submitted select field values prashantchaudhary#46
Browse files Browse the repository at this point in the history
  • Loading branch information
Lukasz Przybysz committed Aug 27, 2017
1 parent 5c1eca6 commit 3f68250
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion jquery.ddslick.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
if (!data) {

var ddSelect = [], ddJson = options.data;
options.data = [];

//Get data from HTML select options
obj.find('option').each(function () {
Expand All @@ -98,7 +99,7 @@
else options.data = $.merge(ddSelect, options.data);

//Replace HTML select with empty placeholder, keep the original
var original = obj, placeholder = $('<div').attr('id', obj.attr('id') + '-dd-placeholder');
var original = obj, placeholder = $('<div>').attr('id', obj.attr('id') + '-dd-placeholder');
obj.replaceWith(placeholder);
obj = placeholder;

Expand All @@ -114,6 +115,8 @@
var ddSelect = obj.find('.dd-select'),
ddOptions = obj.find('.dd-options');

ddSelect.find('input').attr('name', original.attr('name'));

//Set widths
ddOptions.css({ width: options.width });
ddSelect.css({ width: options.width, background: options.background });
Expand Down

0 comments on commit 3f68250

Please sign in to comment.