Skip to:
Content
Pages
Categories
Search
Top
Bottom

The name feild at registration

  • @jessicana

    Participant

    Hello,

    I don’t want the field name to be required at registration. I totally want to “remove” this field and make the registration similar to BBpress where users have to only fill usernames and passwords for registration.

    How to drop the name field and not ask users for it at all during registration?

    Thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • @sbrajesh

    Participant

    Hi,
    Since I got this same question in my email today. Assuming that it was you or a coincidence, I will post the code here as well for everyone else.

    1. BuddyPress Needs the field_1, so you can not delete it. That gives us a solution, we can hide it using css/js and set it’s value to the value of username.

    There are two possible approaches.
    The first step is use following in css

    
    div.field_1{
    display:none;
    }
    
    

    That will hide the input box on the form.

    Now, we can update it using the js or PHP. I will post the simple solution using js

    You can put the following code in your bp-custom.php or functions.php

    
    function buddydev_disable_firstname() {
    	?>
    <script type="text/javascript">
    	jQuery(document).ready(function(){
    
    	var jq=jQuery;
    
    	jq("#signup_username").on("blur",function(){
    
    	jq("#field_1").val(jq("#signup_username").val());
    
    	});
    
    	});
    </script>
    <?php
    }
    add_action( 'bp_after_register_page', 'buddydev_disable_firstname');
    
    

    That should do it.

    There is another pure php solution by settings $_POST[‘field_1’] to the other value but I will leave that for others to figure out 🙂

    @jessicana

    Participant

    @sbrajesh

    Thank you for posting this. It did not work for me. I should have mentioned that I am using multisite.

    @jessicana

    Participant

    Any help … Anyone

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘The name feild at registration’ is closed to new replies.
Skip to toolbar