Advertisement
Guest User

Untitled

a guest
Jun 27th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. <script>
  2. $(function() {
  3. function str_rand() {
  4. var result = '';
  5. var words = '0123456789qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM';
  6. var max_position = words.length - 1;
  7. for( i = 0; i < 12; ++i ) {
  8. position = Math.floor ( Math.random() * max_position );
  9. result = result + words.substring(position, position + 1);
  10. }
  11. return result;
  12. }
  13.  
  14.  
  15. $("#generation").click(function() {
  16. $("#password, #password_confirmation ").val(str_rand());
  17.  
  18. });
  19. });
  20. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement