Skip to content

Commit

Permalink
Merge pull request #37 from zestsoftware/fredvd-orderedselect-ie11
Browse files Browse the repository at this point in the history
Change javascript for updating ordered select widget hidden structure
  • Loading branch information
mauritsvanrees committed Feb 1, 2016
2 parents 53d9d7b + d3fcb51 commit b5a2d0e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
5 changes: 5 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ CHANGES
3.2.9 (unreleased)
------------------

- Change javascript for updating ordered select widget hidden structure so it
works again on IE11 and doesn't send back an empty list that deletes all
selections on save. Fixes https://github.com/zopefoundation/z3c.form/issues/23
[fredvd]

- Started on Dutch translations.
[maurits]

Expand Down
14 changes: 3 additions & 11 deletions src/z3c/form/browser/orderedselect_input.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,17 +108,9 @@ function copyDataForSubmit(name)
{
// create virtual node with suitable attributes
var newNode = document.createElement("input");
var newAttr = document.createAttribute("name");
newAttr.nodeValue = name.replace(/-/g, '.')+':list';
newNode.setAttributeNode(newAttr);

newAttr = document.createAttribute("type");
newAttr.nodeValue = "hidden";
newNode.setAttributeNode(newAttr);

newAttr = document.createAttribute("value");
newAttr.nodeValue = toSel.options[i].value;
newNode.setAttributeNode(newAttr);
newNode.setAttribute("name", name.replace(/-/g, '.')+':list');
newNode.setAttribute("type", "hidden");
newNode.setAttribute("value",toSel.options[i].value );

// actually append virtual node to DOM tree
toDataContainer.appendChild(newNode);
Expand Down

0 comments on commit b5a2d0e

Please sign in to comment.