Skip Navigation

[Resolved] Submit button is disabled

This support ticket is created 7 years, 10 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 5 replies, has 2 voices.

Last updated by Timothy 7 years, 9 months ago.

Assisted by: Shane.

Author
Posts
#407156

Hello,

After a user registers on the site with a User Form I have them directed to a Post Form for adding a cpt. It used to work fine, not sure if an update or some setting I adjusted changed things but now the Submit button on the Post form is disabled so they cannot submit the second form.

You can see this behavior by filling out the initial form:

hidden link

Tim

#407229

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Timothy,

Thank you for contacting our support forum.

We have had issues with our user form since the updates. Would you mind trying the patch below and let me know if it helps ?

https://toolset.com/errata/shortcode-display-form-edit-users-not-working/

Thanks,
Shane

#407287

Thanks, but replaced the file and the button is still disabled. What's odd is that it's not disabled if I'm logged in as an Admin only if I register as a member which puts the user into Author role. I am using Access but this form is not restricting the Author role.

Tim

#407289

Ah, found the reason, I added the code below in my functions file in order to redirect users to their account page when they log in. When removed the button is no longer disabled. So I guess it's causing some type of js error "No 'Access-Control-Allow-Origin' header".

function cm_redirect_users_by_role() {
  
    $current_user   = wp_get_current_user();
    $role_name      = $current_user->roles[0];
  
    if ( 'author' === $role_name ) {
        wp_redirect( '<em><u>hidden link</u></em>' );
    } // if
  
} // cm_redirect_users_by_role
add_action( 'admin_init', 'cm_redirect_users_by_role' );

And I also have code that auto-logs in users once they register, which maybe ultimately leads to this issue.

function auto_login_new_user( $user_id ) {
  wp_set_current_user($user_id);
  wp_set_auth_cookie($user_id);

}
add_action( 'user_register', 'auto_login_new_user' );

Anyway I can have users auto-logged in and have them redirected and not have this disabled issue?

#407498

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Timothy,

Happy you were able to find the issue 🙂

However I cannot assist with custom coding but what I can do is make suggestions 🙂

I found a plugin that does exactly what you are trying to achieve.
https://wordpress.org/plugins/redirect-after-login/screenshots/

Maybe you can try the plugin out as it may resolve your issue.

Please let me know if this helps.
Thanks,
Shane

#412087

thanks

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.