简体   繁体   中英

Password in a form, Foundation 5 (ZURB)

I use foundation ( ZURB ) here is my code:

      <form data-abide>
      <div class="name-field">
      <label>Your name <small>required</small></label>
      <input type="text" required >
      <small class="error">Name is required and must be a string.</small> 
      </div>
      <div class="password-field">
      <label>Password <small>required</small></label> 
      <input type="password" required>
      <small class="error">A Password is required.</small>
      </div>
      <button type="submit">Submit</button>
      </form>

In the Password part I want to replace the password with dots without testing the password, because it requires a complex password of eight as: aaaaaAA2 and in my case I only simple password.

Thanks.

By overriding Abide during Foundation initialization, you can define your own custom patterns or override the default patterns to validate against. To use simple password,

   $(document)
   .foundation()
   .foundation('abide', {
    patterns: {
    password: /^(?=.*\d).{4,8}$/, 
   }
  });

Password must be between 4 and 8 digits long and include at least one numeric digit. Matches 1234 | asdf1234 | asp123 Non-Matches asdf | asdf12345 | password

for more http://foundation.zurb.com/docs/components/abide.html http://regexlib.com/(A(13E-t-BjvZ-WvDNI3kEXWexqe-dnRabCLhUJT4HCwiq39cFxk1bCp2xTgMv4ZLuwh4z02qwn-LwirPbo_Y1NF6Tnx6zEJKJ9ukU7WXcOnRM1))/Search.aspx?k=password&c=-1&m=-1&ps=20&AspxAutoDetectCookieSupport=1

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM