限时优惠活动
亲爱的苦力吧用户,我们为了回馈新老用户一直以来的鼎力支持,即日起(2025-02-06至2025-03-06)凡是购买苦力吧VIP/充值K币的新老用户,都直接可获得买一送一的优惠馈赠。例如:购买一个月的VIP会员可直接获得两个月的VIP会员;充值100K币可直接获得200K币,以此类推!有任何疑问可联系在线客服,感谢各位用户对苦力吧素材的信任与厚爱,我们将一如既往的给大家上新更多优质的素材源码,祝大家开工大吉、工作顺利、心想事成。

html5响应式带显示密码记住密码的会员登录页面模板

所属分类: html模板-表单提交    2023-12-09 01:26:33

html5响应式带显示密码记住密码的会员登录页面模板 ie兼容6
 查看演示  登录后下载 温馨提示
登录会员即可享受免费下载
 我要建站

html5响应式带显示密码记住密码的会员登录页面模板(共3个文件)

    • index.html

使用方法

const frmSignIn = document.getElementById('frmSignIn');
const frmForget = document.getElementById('frmForget');
const frmRegister = document.getElementById('frmRegister');

const inputs = document.querySelectorAll('.asm-form__input');
const showPasswordTogglers = document.querySelectorAll('[data-action="toggle-show-password"]');
const linkButtons = document.querySelectorAll('[data-action="show-form"]');

/* Functions */
const inputLabelFocusOut = event => {
  label = document.querySelector(`label[for="${event.target.id}"]`);
  if(event.target.value.length >0 ) {
    label.classList.add('active');
    label.parentNode.classList.remove('invalid');
  } else {
    label.classList.remove('active');    
  }
}

const inputLabelFocus = event => {
  label = document.querySelector(`label[for="${event.target.id}"]`);
  label.classList.add('active');
  label.parentNode.classList.remove('invalid');
}

const toggleShowPassword = event => {
  const input = document.querySelector(event.target.dataset.input);
  const type = input.getAttribute('type');
  input.setAttribute('type', type==='password'?'text':'password');
}

const showForm = event => {
  event.preventDefault();
  
  for (const form of document.querySelectorAll('.asm-form')) {
    form.classList.remove('active');
  }
  
  for (const error of document.querySelectorAll('.asm-form__inputbox.invalid')) {
    error.classList.remove('invalid');
  }
  
  document.querySelector(event.target.dataset.target).classList.add('active');
}

/* Listener assigns */

for (const input of inputs) {
  input.addEventListener('focusout', inputLabelFocusOut);
  input.addEventListener('focus', inputLabelFocus);
}

for (const toggler of showPasswordTogglers) {
  toggler.addEventListener('click', toggleShowPassword);
}

for (const button of linkButtons) {
  button.addEventListener('click', showForm);
}

/* Form Validator*/

const validateForm = form => {
  const inputs = form.querySelectorAll('.validate');
  for (const input of inputs) {

    input.classList.remove('invalid');
    input.parentNode.classList.remove('invalid');

    let allOK = true;

    switch (input.dataset.validation) {
      case 'regex': {
        allOK = input.value.match(new RegExp(input.dataset.regex));
        break;
      }
      case 'match': {
        allOK = input.value === form.querySelector(input.dataset.target).value;
        break;
      }
      default: {
        allOK = false;
        break;
      }
    } //end of switch

    if (!allOK) {
      input.classList.add('invalid');
      input.parentNode.classList.add('invalid');
      return false;
    }
  } //end of for-of
  
}

站长提示:
1. 苦力吧素材官方QQ群:950875342
2. 平台上所有素材资源,需注册登录会员方能正常下载。
3. 会员用户积极反馈网站、素材资源BUG或错误问题,每次奖励2K币
4. PHP源码类素材,如需协助安装调试,或你有二次开发需求,可联系苦力吧客服。
5. 付费素材资源,需充值后方能下载,如有任何疑问可直接联系苦力吧客服
相关资源 / 表单提交

html5响应式简洁干净的会员登录模板

一款浅蓝色风格登录模板,表单文本框带SVG图标,很漂亮的用户登录页模板。
  表单提交
 381  0

html5响应式带网格动画背景管理员登录页模板

一款深蓝色风格的后台登录页模板,带了粒子自动循环运动及跟随鼠标交互的网格背景动画特效。
  表单提交
 6301  0

html5响应式后台系统会员登录页模板

一款响应式蓝色风格简洁的登录模板,用户名、登录密码、验证码三个表单字段,带简单的输入验证。
  表单提交
 61308  0

html5响应式怀旧老式风格后台登录页模板

一款蓝色风格后台系统登录模板,采用table布局设计,青春怀旧风格。
  表单提交
 482  0

评论数(0) 回复有机会获得K币 用户协议

^_^ 还没有人评论,快来抢个沙发!
😀
  • 😀
  • 😊
  • 😂
  • 😍
  • 😑
  • 😷
  • 😵
  • 😛
  • 😣
  • 😱
  • 😋
  • 😎
  • 😵
  • 😕
  • 😶
  • 😚
  • 😜
  • 😭
发表评论