注意:使用本代码后输入框除了中文 任何字符输入不进去
中文注册
打开:template----default----member----register.htm 如使用的不是默认风格 就找你使用的风格包里
查找:
- <div class="rfm">
- <table>
- <tr>
- <th><span class="rq">*</span><label for="{$this->setting['reginput']['username']}">{lang username}:</label></th>
- <td><input type="text" id="{$this->setting['reginput']['username']}" name="" class="px" tabindex="1" autocomplete="off" size="25" maxlength="15" required /></td>
- <td class="tipcol"><i id="tip_{$this->setting['reginput']['username']}" class="p_tip">{lang register_username_tips}</i><kbd id="chk_{$this->setting['reginput']['username']}" class="p_chk"></kbd></td>
- </tr>
- </table>
- </div>
复制代码
替换为:
<div class="rfm">
<table width="50%">
<tr>
<th>提示语: 本论坛 『 <font color=red>只接受中文注册</font> 』用户名*</th>
</tr>
</table>
</div>
<div class="rfm">
<table>
<tr>
<th><span class="rq">*</span><label for="{$this->setting['reginput']['username']}">{lang username}:</label></th>
<td><input type="text" id="{$this->setting['reginput']['username']}" name="" class="px" tabindex="1" autocomplete="off" size="25" maxlength="15" onpropertychange="with(this)if(/[^\u3447-\uFA29]/ig.test(value))value=value.replace(/[^\u3447-\uFA29]/ig,'')" required /></td>
<td class="tipcol"><i id="tip_{$this->setting['reginput']['username']}" class="p_tip">{lang register_username_tips}</i><kbd id="chk_{$this->setting['reginput']['username']}" class="p_chk"></kbd></td>
</tr>
</table>
</div>
注意:使用本代码后输入框除了英文 任何字符输入不进去
英文注册
上面红色处 替换
- onkeyup="this.value=this.value.replace(/[^\a-\z|A-Z]/g,'')" onblur="this.value=this.value.replace(/[^\a-\z|A-Z]/g,'')"
复制代码
注意:使用本代码后输入框除了数字 任何字符输入不进去
数字注册
上面红色处 替换
- onkeyup="value=value.replace(/[^\d]/g,'') "onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))"
复制代码
|
上一篇: c#做web浏览器下一篇: Discuz X1.5/2 实时天气预报+万年历 v2.01
|