Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script>
- $(function() {
- function str_rand() {
- var result = '';
- var words = '0123456789qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM';
- var max_position = words.length - 1;
- for( i = 0; i < 12; ++i ) {
- position = Math.floor ( Math.random() * max_position );
- result = result + words.substring(position, position + 1);
- }
- return result;
- }
- $("#generation").click(function() {
- $("#password, #password_confirmation ").val(str_rand());
- });
- });
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement