Forum Replies Created
-
While attempting another solution, I found a new problem. I got rid of the placeholder attribute and went back to using the label as you suggested. I positioned the label beneath the input and gave the input a transparent background. I was using the :focus and :valid states to hide and re-position the labels and inputs as needed. This worked fine on the inputs in the basic-details-section div, but the input in the profile-details-section doesn’t seem to be responding to the :focus or :valid states. I can apply regular styles, but nothing more. Can you think of any reason why that may be?
That makes sense Hugo. I’ll look for a javascript/css solution. Support is pretty good for the placeholder attribute already though. I’d be willing to accept what I might lose. It would be nice to have the choice in all input fields.
Yes, I’ve already edited the input fields within the basic-details-section div. I want to edit the input field in the profile-details-section div to match, but there is no input field in the register.php for that section. Instead there’s this:
<div class="register-section" id="profile-details-section"> <h4><?php _e( 'Profile Details', 'buddypress' ); ?></h4> <?php /* Use the profile field loop to render input fields for the 'base' profile field group */ ?> <?php if ( bp_is_active( 'xprofile' ) ) : if ( bp_has_profile( array( 'profile_group_id' => 1, 'fetch_field_data' => false ) ) ) : while ( bp_profile_groups() ) : bp_the_profile_group(); ?>
Is there any way to get at the input tag that gets output to the profile-details-section?
That’s the right area, but no… I mean doing something like this:
<input type="text" placeholder="<?php _e('Username', 'buddypress'); ?> <?php _e( '(required)', 'buddypress' ); ?>" name="signup_username" id="signup_username" value="<?php bp_signup_username_value(); ?>" />
Instead of something like this:
<label for="signup_username"><?php _e( 'Username', 'buddypress' ); ?> <?php _e( '(required)', 'buddypress' ); ?></label>
…only for the profile field.
Thanks for your reply! I’m not sure I explained myself very well… When I refer to “placeholder”, I mean the text that is already in the input field when the page loads. This will be a responsive them and the end goal here is to save as much space as possible on the registration form by removing the labels altogether. I need to be able to output some default text into the field that will then disappear when the user begins typing in that field.