- Avoid duplicate ID warning by only returning the value from the matching radio button

- Fix radiobuttons where the options/values were set in the template instead of sel_options
This commit is contained in:
Nathan Gray 2014-07-07 16:19:37 +00:00
parent 715580aca4
commit 15ddeb2a24
2 changed files with 6 additions and 1 deletions

View File

@ -79,6 +79,11 @@ class etemplate_widget_checkbox extends etemplate_widget
{
$valid = $value;
}
elseif ( !$options && $selected_value && $value == $selected_value)
{
// Options set in template, not in sel_options
$valid = $selected_value;
}
elseif (!isset($valid))
{
$valid = ''; // do not overwrite value of an other radio-button of the same group (identical name)!

View File

@ -133,7 +133,7 @@ var et2_radiobox = et2_inputWidget.extend(
}
}, this, et2_radiobox);
return val;
return val == this.options.set_value ? this.options.set_value : null;
}
});
et2_register_widget(et2_radiobox, ["radio"]);