PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Checking if user has submitted

  1. WPSpecialists
    Member

    I need to check (outside of the form) if the form has already been submitted by the logged in user. I've searched for the answer for awhile but now I feel like I'm going in circles. I'm assuming there's an easy solution and I'm just not finding it.

    Could someone please help me with this?

    $user_info = get_userdata( $current_user->ID );
    // if the user has submitted form 53
    
    // do this
    
    // if they haven't submitted
    else echo "Slow down, Sparky! You have to fill out this form first.";

    Thanks so much for any help you might be able to offer!!!

    Posted 12 years ago on Tuesday September 13, 2011 | Permalink
  2. WPSpecialists
    Member

    Alrighty -- Figured it out.

    if ( is_user_logged_in() ) {
    $user_info = get_userdata( $current_user->ID );
    $entry_count = RGFormsModel::get_lead_count($form_id, $user_info->user_login);
    if($entry_count >= "1") {
    // what to do if they already submitted the form at least once
    } else {
    echo "Slow down, Sparky! You have to fill out this form first.";
    } }
    Posted 12 years ago on Tuesday September 13, 2011 | Permalink
  3. Very nice. Thanks for posting your solution.

    Posted 12 years ago on Wednesday September 14, 2011 | Permalink

This topic has been resolved and has been closed to new replies.