This topic has 7 replies, 2 voices, and was last updated 10 years by Abe.

  • Author
  • #9392
     frien337
    Participant

    Hello Everyone,

    I don’t want my user to have to provide their name. Is there a way that I can disable this field or even make it non mandatory?

    Thanks,
    Ryan

    #9485
     Abe
    Keymaster

    Hi, You can add this script in footer.php just before wp_footer line. This will hide the full name in the register page and because it is a require field it will take the value of username

    COPY CODE
    
    <script>
    var url = document.location.href;
    jQuery(document).ready(function() {
    //copy profile name to account name during registration
    if (url.indexOf("register/") >= 0) {
        jQuery('label[for=field_1],#field_1, #field-visibility-settings-toggle-1').css('display','none');
        jQuery('#signup_username').blur(function(){
            jQuery("#field_1").val(jQuery("#signup_username").val());
        });
    }
    });
    </script>
    
    
    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

    #9533
     frien337
    Participant

    Thanks Abe, this has worked perfectly. I just had to make a small change by adding in a “/” before the “register/” text. Here’s the updated one for anyone who needs this:

    COPY CODE
    
    <script>
    var url = document.location.href;
    jQuery(document).ready(function() {
    //copy profile name to account name during registration
    if (url.indexOf("/register/") >= 0) {
        jQuery('label[for=field_1],#field_1, #field-visibility-settings-toggle-1').css('display','none');
        jQuery('#signup_username').blur(function(){
            jQuery("#field_1").val(jQuery("#signup_username").val());
        });
    }
    });
    </script>
    
    #9558
     frien337
    Participant

    Hi Abe,

    It doesn’t seem to be working 100% correctly. That bit of code has hidden the full name field just fine but when I try to register I still get a message saying “This is a required field” where the name field is hidden. any more ideas? 🙂

    If you need to see my registration page you can do so at:
    http://www.friendsireland.com/niam/
    This is the default page without the code you have provided me with.

    Thanks,
    Ryan

    #9560
     frien337
    Participant

    Just realised my 2nd reply messed up when I pasted the code into this forum; it should have liked this:


    <script>
    var url = document.location.href;
    jQuery(document).ready(function() {
    //copy profile name to account name during registration
    if (url.indexOf("register/") >= 0) {
    jQuery('label[for=field_1],#field_1, #field-visibility-settings-toggle-1').css('display','none');
    jQuery('#signup_username').blur(function(){
    jQuery("#field_1").val(jQuery("#signup_username").val());
    });
    }
    });
    </script>

    #9595
     Abe
    Keymaster

    Hi, Should have used my initial code because now the javascript is probably not applying and not copying your username to your full name field

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

    #9643
     frien337
    Participant

    Thanks Abe, however, I don’t think that is the problem because I still get the same result when using your code.

    Is there any other ideas that you may have?

    Thanks,
    Ryan

    #9704
     Abe
    Keymaster

    Try without the register condition and see if it works

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

Viewing 8 posts - 1 through 8 (of 8 total)

The forum ‘Sweetdate – WordPress’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?