• 欢迎 游客 您的光临,下载之前请先阅读 积分规则 。任何技术问题请在论坛提问,本站定制插件、模板主题。售前、售后问题请联系QQ:5916171
    本站自由发布资源可赚取积分及人民币(可提现)(保证资源真实可用,如被举报封号处理。谨慎分布)。
  • 即日起发表主题、回帖、发布&更新资源、创建&回复私信、发布&回复个人动态均需要验证手机号码,其它不受影响。如不便可进群提问。点击链接加入群聊【XenForo讨论社区】:群号1:143277648

技巧教程 为注册页面添加重置按钮

UID
875
注册
2020/06/14
消息
37
黄金
3G
  • #1
后台→外观→模板列表→搜索register_macros并打开

拉到最后,将里面的
HTML:
扩展 折叠 复制
<xf:macro name="submit_row">
    <span id="js-regTimer" data-timer-complete="{{ phrase('register') }}">
                <xf:submitrow><xf:html>
        <xf:button type="submit" class="button--primary" id="js-signUpButton"  style="float: left;">
            <xf:if is="$xf.options.registrationTimer">
                    {{ phrase('(please_wait_x_seconds)', {'seconds': "<span>{$xf.options.registrationTimer}</span>"}) }}
                </span>
            <xf:else />
                {{ phrase('register') }}
            </xf:if>
        </xf:button>
    </xf:html></xf:submitrow>
</xf:macro>

改为

HTML:
扩展 折叠 复制
<xf:macro name="submit_row">
    <span id="js-regTimer" data-timer-complete="{{ phrase('register') }}">
                <xf:submitrow><xf:html>
        <xf:button type="submit" class="button--primary" id="js-signUpButton"  style="float: left;">
            <xf:if is="$xf.options.registrationTimer">
                    {{ phrase('(please_wait_x_seconds)', {'seconds': "<span>{$xf.options.registrationTimer}</span>"}) }}
                </span>
            <xf:else />
                {{ phrase('register') }}
            </xf:if>
        </xf:button>
        <xf:button type="reset" class="button--primary" style="float: left;margin-left: 100px;">
                {{ phrase('reset') }}
        </xf:button>
    </xf:html></xf:submitrow>
</xf:macro>

效果如下(自行添加CSS)
1673866898579.png

如果想添加确认提示可将
HTML:
扩展 折叠 复制
<xf:button type="reset" class="button--primary" style="float: left;margin-left: 100px;">{{ phrase('reset') }}</xf:button>
替换为
HTML:
扩展 折叠 复制
<xf:button type="reset" class="button--primary" style="float: left;margin-left: 100px;" onclick="return(confirm('是否重置当前填写的内容?'))">{{ phrase('reset') }}</xf:button>
效果如下
1673867216232.png
 
最后编辑:
打赏用户
死了算了
后退
顶部 底部