Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter platinumrealty

    (@platinumrealty)

    This is what’s in my theme-my-login-custom.php:

    /* Edit to add required checkbox to registration form code jan 7 14
    */
    function tml_registration_errors( $errors ) {
    if ( empty( $_POST[‘tos’] ) )
    $errors->add( ’empty_tos’, ‘ERROR: Please read and accept our TOS in order to continue.’ );
    return $errors;
    }
    add_filter( ‘registration_errors’, ‘tml_registration_errors’ );

    function tml_user_register( $user_id ) {
    if ( !empty( $_POST[‘tos’] ) )
    update_user_meta( $user_id, ‘tos’, $_POST[‘tos’] );
    }
    add_action( ‘user_register’, ‘tml_user_register’ );
    ?>

    Thread Starter platinumrealty

    (@platinumrealty)

    Also,

    When a new subscriber tried to register, they check the checkbox and hit ‘register’ button but the page keeps showing error message and does not permit them to go beyond the registration page.

    How may I fix this? I followed the code as outlined in the link above…

    Thread Starter platinumrealty

    (@platinumrealty)

    Resolved with https://www.w3schools.com
    See below code in copy of register-form.php used for anyone seeking help with same/similar:

    <input type="checkbox" name="tos" disabled value="<?php $template->the_posted_value( 'tos' ); ?>" checked> I have read and agree to your TOS

    (add this code to the above to hyperlink anything in above value section to open in a new window: <a href="https://www.mydomain.com/tos/">

    This code auto selects the checkbox and disables it (words: ‘checked’ and ‘disabled’ used above) as well as aligns the text right next to the checkbox (versus far far away from it to the right!)

    I also removed this code from my theme-my-login-custom.php that I had inserted as above:

    function tml_registration_errors( $errors ) {
    if ( empty( $_POST['tos'] ) )
    $errors->add( 'empty_tos', 'ERROR: Please read and accept our TOS in order to continue.' );
    return $errors;
    }
    add_filter( 'registration_errors', 'tml_registration_errors' );
    
    function tml_user_register( $user_id ) {
    if ( !empty( $_POST['tos'] ) )
    update_user_meta( $user_id, 'tos', $_POST['tos'] );
    }
    add_action( 'user_register', 'tml_user_register' );
    ?>
    Thread Starter platinumrealty

    (@platinumrealty)

    solved!

    Thanks a lot platinumrealty!!!, I was seeking for this!!!!

    ?? ?? ??

    vinoth Kumar

    (@vinothkumarp86)

    Hi,
    I have integrated this plugin to my website. It works fine. But I want to add one new field to registration form. How can i add.

    Please help me.

    Thanks.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Lining up checkbox with label on register form’ is closed to new replies.