BuddyDev

Search

BuddyPress Ajax Registration

  • Participant
    Level: Enlightened
    Posts: 32
    Diana on #9983

    Hello Brajesh,

    I was able to get the registration form to display fine. How might I alter the registration form to show placeholders? I don’t mind adding them by hand, but my php is very poor.

    I believe I can fiddle the css for everything else.

    Thank you for running such a wonderful site. Your plugins are useful, pricing reasonable, and blogs very helpful.

    Diana

  • Keymaster
    (BuddyDev Team)
    Posts: 24210
    Brajesh Singh on #9984

    Hi Diana,
    Thank you for the kind words.

    To make the placeholder, Please copy the file ‘ajax-register-form.php’ from the ajax registration plugin to your theme.

    Once you have done it, you will see some php code

    You can add the placeholder attribute to the text fields. Please do note that it won’t be feasible for the dynamic profile fields(BuddyPress generates the actual html for that), but you can do it for the username, email, password etc as they are static fields.

    Hope that helps.

    Regards
    Brajesh

  • Participant
    Level: Enlightened
    Posts: 32
    Diana on #9990

    Hi Brajesh,

    Yes, adding a placeholder attribute to static fields is easy. Adding them to the xprofile fields is a stinker. Found this post: https://stackoverflow.com/questions/25485299/how-to-add-placeholder-in-buddypress-registration-how-to-make-field-descriptio

    but haven’t been able to get it working yet.

  • Keymaster
    (BuddyDev Team)
    Posts: 24210
    Brajesh Singh on #9994

    Hi Diana,
    Will you like to use the field name or description as the placeholder? Please let me know and I will put some code. It should work.

    Thank you
    Brajesh

  • Participant
    Level: Enlightened
    Posts: 32
    Diana on #10008

    Hi Brajesh,

    Using the description as a placeholder would be best, I believe. Then one could use both the field name as label together with a placeholder, but then just display a placeholder on small screens.

    I’m also going to see what I can figure out, although my php skills are poor and I’m just now figuring out a little about BuddyPress (& WP) template hierarchy and what each template does.

    I’m beginning to see why there are so few really good registration forms for BuddyPress. You can find a bunch for WordPress but those write their extra fields into a different meta table. And many other forms want to use their own table data for profiles and bypass BuddyPress altogether.

    I tried to make something with Caldera Forms (free) using their examples but got befuddled. That form builder, though has wonderful options for placeholders & class names for easy styling.

    Thank you so much for making this registration form available at a reasonable price. I do all my programming / design stuff for free for a few small non-profits that work with kids.

  • Participant
    Level: Enlightened
    Posts: 32
    Diana on #10011

    Woops. A second issue. From the documentation:

    “Customizing the Layout template:-

    I have included a registration page(ajax-registration-form.php) in the plugin. If you want to use your own registration page, you can create the ajax-registration-form.php in your theme and It will load automatically.”

    I copied ajax-registration-form.php to my child theme’s directory but it’s not loading. It threw this error on my local development:

    “Warning: include_once(C:\Program Files (x86)\Ampps\www\wp\wp-content\plugins\bp-ajax-registration/ajax-register-form.php): failed to open stream: No such file or directory in C:\Program Files (x86)\Ampps\www\wp\wp-content\plugins\bp-ajax-registration\core\registration-handler.php on line 523”

    For now I just renamed the original form and am messing with a copy ajax-registration-form.php in the plugin directory, but will need to keep a backup elsewhere for when the plugin is updated.

    I am really liking this plugin so far!

  • Participant
    Level: Enlightened
    Posts: 32
    Diana on #10012

    Belay that last message. I had named my registration form “ajax-registration-form.php” and the plugin wanted it to be named “ajax-register-form.php”. My apologies.

  • Keymaster
    (BuddyDev Team)
    Posts: 24210
    Brajesh Singh on #10014

    Hi Diana,
    No problem.

    Please put this in your bp-custom.php

    
    
    /**
     * Add the field description as placeholder of the BuddyPress Profile field.
     * @param  array $atts attributes.
     *
     * @return mixed
     */
    function buddydev_add_field_desc_as_placeholder( $atts ) {
    
    	$atts['placeholder'] = bp_get_the_profile_field_description();
    
    	return $atts;
    }
    add_filter( 'bp_xprofile_field_edit_html_elements', 'buddydev_add_field_desc_as_placeholder' );
    
    

    It will make the field description as the placeholder.

    Regards
    Brajesh

  • Participant
    Level: Enlightened
    Posts: 32
    Diana on #10027

    Hi Brajesh,

    It now displays the description as both a placeholder and description text under the input box, but it’s easy enough to hide the text under the input box with css.

    THANK YOU very much!
    Diana

  • Keymaster
    (BuddyDev Team)
    Posts: 24210
    Brajesh Singh on #10028

    Hi Diana,
    Thank you.
    Since the description is part of the register form, you will either need to remove the php code from the file

    
    <p class="description"><?php bp_the_profile_field_description() ?></p>
    
    

    or you can hide it using css. Both ways are fine.

    Thank you
    Brajesh

You must be logged in to reply to this topic.

This topic is: not resolved