• Resolved creativemash

    (@creativemash)


    Hi,

    I have found that some users are finding hard to register to my site as if they fill out the form and forget to fill in a required form that is at the bottom and submit the page reloads and sends them to the top they do not see the required error message that is down the page at the field in question and just the user just thinks that the form has been submitted successfully.

    Is there a way to get either 1. the error messages to the top of the form or 2. have a generic error message and the top that says something like “Please fill in required fields below”

    Regards,
    Matthew

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor Champ Camba

    (@champsupertramp)

    Hi @creativemash

    You can try this custom code to add an error message above the form:

    add_action("um_before_form","um_custom_error_message_before_form", 9, 1 );
    function um_custom_error_message_before_form( $args ){
       
       if( $args['form_id'] != 123 ) return; // apply to form ID 123
     
       if ( UM()->form()->count_errors() > 0 ) {
    	_e("There are field errors below","ultimate-member");	
       }
    
    }

    Regards,

    Thread Starter creativemash

    (@creativemash)

    @champsupertramp thanks for that, just what I wanted ??

    Plugin Contributor Champ Camba

    (@champsupertramp)

    Hi @creativemash

    Thanks for letting us know. I am closing this thread now.

    Regards,

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Form Required Error Messages move to top of page’ is closed to new replies.