免費論壇 繁體 | 簡體
Sclub交友聊天~加入聊天室當版主
分享
返回列表 發帖

[問題] 如何实现注册时限制邮箱为QQ邮箱?

我在注册页面模板里用了正则表达式,但似乎不起作用。
  1. <label>提示语:1、本论坛 『 <font color=red>只接受中文注册</font> 』用户*</label>
  2. <label>    2、本论坛 『 <font color=red>只接受QQ邮箱注册</font> 』用户*</label>
  3. <label><em>{lang username}:</em><input type="text" size="25" maxlength="15" name="username" id="username" value='' onpropertychange="with(this)if(/[^\u4e00-\u9fa5]/ig.test(value))value=value.replace(/[^\u4e00-\u9fa5]/ig,'')" onBlur="checkusername()" tabindex="1" class="txt" /> *</label>
  4.                                         <label><em>{lang password}:</em><input type="password" name="password" size="25" id="password" onkeypress="detectCapsLock(event, this)" tabindex="1" class="txt" /> *</label>
  5.                                         <label><em>{lang password_confirm}:</em><input type="password" name="password2" size="25" id="password2" onkeypress="detectCapsLock(event, this)" tabindex="1" value="" class="txt" /> *</label>
  6.                                         <label><em>{lang email}:</em><input type="text" name="email" autocomplete="off" size="25" id="email" value='' onpropertychange="with(this)if(/[^[\w-]+(\.[\w-]+)*@qq(\.[\w-]+)+$]/ig.test(value))value=value.replace(/[^[\w-]+(\.[\w-]+)*@qq(\.[\w-]+)+$]/ig,'')" onBlur="checkemail()" tabindex="1" class="txt" /> *</label>
複製代碼

QQ邮箱限制已经实现,谢谢章鱼大大!为方便后来的朋友,解决方法链接发在这:
http://sclub.com.tw/discuz/viewthread.php?tid=23627

TOP

章鱼已经发布了

TOP

返回列表