moffee's blog

shopex472英文注册界面的简化方法

老外注册很多都喜欢用email注册,既保证了注册ID的唯一性,也同时取得了用户的email,方便快捷。

shopex4.72的英文注册比较繁琐,删除了所有的非必填项后,还有用户名、密码、email三项,把用户名改成email,然后加上email判定的js,这样,用户名就必须是email形式的了。

但是后面还有一个email输入框,如果强行删除email输入框的话,注册的时候会报错,提示email为空。

解决的思路是:当用户输入用户名(也就是用email注册了)的时候,自动填写和用户名一样的email,同时把email输入框隐藏起来。这样的话,用户可以少一项无谓的重复填写,同时后台也有了email这一项,不影响给用户发送email。

用js来实现:

在username的input里面加入 onkeyup=”document.all.email.value=this.value” 即可。

完整代码如下:

 
<form name=”FORM_TPL_REGISTER2″ action=”index.php” method=”post” onSubmit=”return Form_Validator(this)”>
  {form_hidden_value}
  <div class=”loginform”>
    <label>Youre Email:</label>
    <input type=”text” name=”username” class=”inputstyle” onkeyup=”document.all.email.value=this.value” />
    <span class=”p9orange”>*</span></span> <br />
    <label>Password:</label>
    <input type=”password” name=”passwd” class=”inputstyle” />
    <span class=”p9orange”>*</span>min 4 characters and max 20 characters.</span> <br />
    <label>Re-enter Password:</label>
    <input type=”password” name=”repasswd” class=”inputstyle” />
    <label>&nbsp;</label>
    <input type=”hidden” type=”text” name=”email” class=”inputstyle” />
    <input name=”Submit” type=”submit” class=”buttonstyle” value=”Submit” />
    <br />
  </div>
</form>

评论列表

 
  1. 还没有任何评论,你来说两句吧

 

发表评论

 
  • 发表评论