silence
Well-known member
Alright so I have a foreach loop and I'm trying to increment it after clicking the button, however it won't work. Is there a non-custom JS solution to this or is this an underlying flaw in XenForo?
Fieldset:
Screenshot:
Fieldset:
PHP:
<fieldset>
<xen:if is="!{$auth_id}">
<dl class="ctrlUnit inputBox">
<dt><label for="ctrl_auth_id">{xen:phrase teamspeak_identity}</label></dt>
<dd><input type="text" name="auth_id[]" value="None" id="ctrl_auth_id" class="textCtrl" /></dd>
</dl>
<xen:else />
<xen:foreach loop="$auth_id" key="$key" value="$value" i="$i">
<dl class="ctrlUnit inputBox">
<dt><label for="ctrl_auth_id">{xen:phrase teamspeak_change_identity} #{$i}</label></dt>
<dd><input type="text" name="auth_id[]" value="{$value}" id="ctrl_auth_id" class="textCtrl" /></dd>
</dl>
</xen:foreach>
<input type="button" value="{xen:phrase teamspeak_add_identity}" class="button smallButton FieldAdder JsOnly" data-source="dl.inputBox" data-maxfields="{$visitor.permissions.teamspeak.teamspeakIdentityCount}" />
</xen:if>
</fieldset>
Screenshot: