Skip to:
Content
Pages
Categories
Search
Top
Bottom

[Resolved] Registration validation for "if ANY errors"?


  • adamt19
    Participant

    @adamt19

    I’m using BP 2.0 and I’m looking for a way to check if there were ANY errors of any kind during sign-up, so that I may print specific content at the top of the page.

    Currently, the user has to scroll down to each individual field and find the error labels. Which, apparently, despite being bright red, can be missed.

    I want to modify the heading to make the situation more clear.

    Also, why does Birthday field reset when there are errors? My users are fixing the field-in-question but not noticing that Birthday is being reset, which, since it is required on our site, sends them once again back to the top of the registration form.

    Understandably frustrating. Any pointers?

Viewing 7 replies - 1 through 7 (of 7 total)

  • adamt19
    Participant

    @adamt19

    cliff notes on these questions:

    • Why does the <select> options for birthdays reset when reg form is submitted with errors
    • Is there a conditional check available on registration load to see if form is being re-rendered due to errors.

    anyone?


    adamt19
    Participant

    @adamt19

    I’ve resorted to a javascript solution which checks for the existence of “error” divs within my registration form and modifies the HTML of the headline above the form, if necessary.

    Note: this code is specific for my registration form, which uses .six .columns grid framework and a short vs. extendable registration experience, depending on how much time the user feels like spending on optional fields from extra field groups. Anyway:

    if (jQuery('.row .six div.error').html()) {
        		jQuery('h2.article-title').html('Wait! Something needs fixing, below.');
        		jQuery('p.lead').html('There is at least one error marked below. We\'ve expanded the form to help you find them.');
        		jQuery('.extended').fadeIn(1000);
      		}

    It seems there should be some more practical/server-side method for this.

    Still looking for answers/help on the birthday thing! 🙂


    adamt19
    Participant

    @adamt19

    It’s actually only the Month and Year that reset, which makes this more confusing.

    none of the other <select>-driven options reset either


    Ircsome
    Participant

    @ircsome

    Try inserting this or something similar) at the appropriate point in register.php ….

    			
    <?php if (!( 'completed-confirmation' == bp_get_current_signup_step() )) {
    echo '<p><strong>There was an error - check below to correct any error and resubmit the form.</strong></p>'; 
    }?>
    

    adamt19
    Participant

    @adamt19

    @ircsome will try it – but seems like that would eval TRUE on every registration page load (including initial visit)


    Ircsome
    Participant

    @ircsome

    you are correct … but it’s the best option I’ve come up with so far 🙂


    adamt19
    Participant

    @adamt19

    add a step parameter to the action?

    eg action=”/register/?r=submitted”

    🙂

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘[Resolved] Registration validation for "if ANY errors"?’ is closed to new replies.
Skip to toolbar