Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_action('wcfm_membership_registration_form_after_dynamic_custom_fields', function () {
- ?>
- <style>
- div#wcfm_membership_registration_form_expander {
- position: relative;
- }
- div#wcfm_membership_registration_form_expander span.password-visibility {
- position: absolute;
- right: 20px;
- margin-top: 8px;
- }
- </style>
- <?php
- });
- add_action('end_wcfm_membership_registration_form', function () {
- ?>
- <script>
- jQuery(function($) {
- $html = '<span class="wcfmfa fa-eye text_tip password-visibility"></span>';
- $('#wcfm_membership_registration_form input[type="password"').after($html);
- $('#wcfm_membership_registration_form').on('click', 'span.password-visibility', function(e) {
- $pass_input = $(this).prev('input');
- if($(this).hasClass('fa-eye-slash')) {
- $pass_input[0].type = 'password';
- $(this).removeClass('fa-eye-slash');
- $(this).addClass('fa-eye');
- } else {
- $pass_input[0].type = 'text';
- $(this).removeClass('fa-eye');
- $(this).addClass('fa-eye-slash');
- }
- });
- });
- </script>
- <?php
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement