web界面 之 登录 (初稿)

时间:2023-03-08 19:24:04
web界面 之 登录 (初稿)

web登录一般注意以下几点:

1)拥有元素:用户名,密码(密码字符显示与隐藏功能),登录按钮,忘记密码链接(忘记用户名链接),注册链接

2)用户体验:

•页面显示,光标默认停在第一个输入框 利用html5的 autofocus属性实现

•密码默认以....显示,利用input标签的 type="password"实现

•点击登录按钮后,利用ajax技术先验证用户名是否存在,密码是否正确,不正确要有合理的提示;正确才能进行页面跳转

•禁掉css后 表单仍然显示比较好的格式

<fieldset id="login">
<legend>后台登录系统</legend>
<form>
<p>
<label>用户名
<input name="name" class="name" type="text" id="name" value="" autofocus="autofocus" />
</label>
</p>
<p>
<label>密 码
<input name="password" class="password" type="password" id="password" value="" />
</label>
</p>
<p id="warning" class="warning"></p>
<p>
<input type="button" id="submitBtn" class="button" value="登录"/>
</p>
</form>
</fieldset>