init: function(canEditEveryone) {
// disable 'Everyone' input
this._canEditEveryone = (canEditEveryone === true) ? true : false;
- var $defaultValue = $('#defaultValueContainer').find('input, textarea').removeAttr('id').removeAttr('name');
+ var $defaultContainer = $('#defaultValueContainer');
+ var $defaultValue = $defaultContainer.find('input, textarea').attr('id', 'optionValue' + $defaultContainer.children('dl').data('groupID')).removeAttr('name');
if (!this._canEditEveryone) {
$defaultValue.attr('disabled', 'disabled');
}
- // remove id and name-attribute from input elements
- $('#otherValueContainer').find('input, textarea').removeAttr('id').removeAttr('name');
+ // fix id and remove name-attribute from input elements
+ $('#otherValueContainer > dl').each(function(index, container) {
+ var $container = $(container);
+ $container.find('input, textarea').removeAttr('name').attr('id', 'optionValue' + $container.data('groupID'));
+ });
// bind event listener
$('#submitButton').click($.proxy(this._click, this));
<script type="text/javascript">
//<![CDATA[
$(function() {
- new WCF.ACP.Options.Group({@$userGroupOption->optionID}, {if $canEditEveryone}true{else}false{/if});
+ new WCF.ACP.Options.Group({if $canEditEveryone}true{else}false{/if});
});
//]]>
</script>
<legend>{lang}wcf.acp.group.option.defaultValue{/lang}</legend>
<dl data-group-id="{@$groupEveryone->groupID}">
- <dt>{lang}{$groupEveryone->groupName}{/lang}</dt>
+ <dt><label for="optionValue{@$groupEveryone->groupID}">{lang}{$groupEveryone->groupName}{/lang}</label></dt>
<dd>{@$defaultFormElement}</dd>
</dl>
</fieldset>
{foreach from=$groups item=group}
<dl data-group-id="{@$group->groupID}">
- <dt>{lang}{$group->groupName}{/lang}</dt>
+ <dt><label for="optionValue{@$group->groupID}">{lang}{$group->groupName}{/lang}</label></dt>
<dd>{@$formElements[$group->groupID]}</dd>
</dl>
{/foreach}