Commit d5f3d796 authored by Rafael Ostertag's avatar Rafael Ostertag
Browse files

Allow spaces in value when selection <radio> and <select> tags.

parent de4255f6
......@@ -38,7 +38,7 @@ QfqNS.Element = QfqNS.Element || {};
Radio.prototype.setValue = function (val) {
this.$element.prop('checked', false);
this.$element.filter('[value=' + val + "]").prop('checked', true);
this.$element.filter('[value="' + val.replace(/"/g, "\\\"") + '"]').prop('checked', true);
};
Radio.prototype.getValue = function () {
......
......@@ -77,7 +77,7 @@ QfqNS.Element = QfqNS.Element || {};
// First, see if we find an <option> tag having an attribute 'value' matching val. If that doesn't work,
// fall back to comparing text content of <option> tags.
var $selectionByValue = this.$element.find('option[value=' + val + ']');
var $selectionByValue = this.$element.find('option[value="' + val.replace(/"/g, "\\\"") + '"]');
if ($selectionByValue.length > 0) {
$selectionByValue.prop('selected', true);
} else {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment