Use placeholders instead of labels

Home Forums BP Profile Search Forum Use placeholders instead of labels

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #11238 Reply
    Adele
    Guest

    Hi Andrea

    How can I customise the form template to use placeholder text instead of labels?

    #11239 Reply
    andrea
    Keymaster

    Hi Adele,

    If you wish to customize the textbox search fields, locate the ‘textbox’ case in the template, and add the placeholder attribute:

    	case 'textbox':
    ?>
    			<input placeholder=<?php echo $f->label; ?> type="search" id="<?php echo $id; ?>" name="<?php echo $name; ?>" value="<?php echo $value; ?>"><br>

    Then you will have to remove the label for the textbox fields. Locate the lines that display the field label, and enclose them in an if statement:

    		<?php if ($display != 'textbox') { ?>
    			<label for="<?php echo $id; ?>" class="bps-label">
    				<strong><?php echo $f->label; ?></strong><span> <?php echo $f->mode; ?></span>
    			</label><br>
    		<?php } ?>

    To read more about modifying the default form template, please see:

    https://dontdream.it/bp-profile-search/form-templates/

Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: Use placeholders instead of labels
Your information: