Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: Change error message display

@imjscn

Participant

I updated my code to include all the field I need to validate on the signup page:
`<?php
function elsa_err_username( ) {
global $bp;
if ( !empty( $bp->signup->errors ) )
echo ‘color:red’;
}
add_action ( ‘elsa_err_username’,’elsa_err_username’ );

function elsa_err_email( ){
global $bp;
if ( !empty( $bp->signup->errors ) )
echo ‘color:red’;
}
add_action ( ‘elsa_err_email’,’elsa_err_email’ );

function elsa_err_pass( ){
global $bp;
if ( !empty( $bp->signup->errors ) )
echo ‘color:red’;
}
add_action ( ‘elsa_err_pass’,’elsa_err_pass’ );

function elsa_err_x( ) {
global $bp;
if ( $field_id == 1 && !empty( $bp->signup->errors ) )
echo ‘color:red’;
else
if ( !empty( $bp->signup->errors ) )
echo ‘color:red’;
}
add_action ( ‘elsa_err_x’,’elsa_err_x’ );
?>`
It get the result of changing the label color if there’s an error. But I guess there has to be a smart way to do it ?
I also removed the line of “do_action(‘bp_ …. error”) which was below each label that need validate. I don’t know what else this line does beside creating a templete for displaying error message. ???
Thanks for helping!

Skip to toolbar