Title: Adding warning message on submit
Last modified: May 23, 2021

---

# Adding warning message on submit

 *  [islp](https://wordpress.org/support/users/islp/)
 * (@islp)
 * [5 years ago](https://wordpress.org/support/topic/adding-warning-message-on-submit/)
 * Hi, in my website I have a contact form.
 * Only logged in users can submit the form: so, the form is apparently only reachable
   if the user is logged in.
 * The issue: a lot of people submit the form, then they switch to other apps on
   their devices. When, after some days, users come to submit the form again they
   are NOT logged in anymore but still see the form in a cached browser window: 
   since subscribers_only is active, they can’t really post anything. What they 
   see is the circular graphics without a warning message.
 * Is there any way to add a message when they click the submit button and they 
   are not logged in?

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

 *  [Erik](https://wordpress.org/support/users/codekraft/)
 * (@codekraft)
 * [5 years ago](https://wordpress.org/support/topic/adding-warning-message-on-submit/#post-14472073)
 * is the subscriber mode good for your purpose?
 * [https://contactform7.com/additional-settings/#subscribers-only-mode](https://contactform7.com/additional-settings/#subscribers-only-mode)
 *  Thread Starter [islp](https://wordpress.org/support/users/islp/)
 * (@islp)
 * [5 years ago](https://wordpress.org/support/topic/adding-warning-message-on-submit/#post-14472094)
 * [@codekraft](https://wordpress.org/support/users/codekraft/) : no, it isn’t. 
   The form is displayed in a webpage only if the user is logged in (or when the
   form is cached). The subscribers_mode is active but it is not relevant because
   it works with public forms and my form isn’t public.
 *  [Erik](https://wordpress.org/support/users/codekraft/)
 * (@codekraft)
 * [5 years ago](https://wordpress.org/support/topic/adding-warning-message-on-submit/#post-14472169)
 * yes but if you aren’t logged in you can’t submit the form (or better, you can’t
   load the form):
    check this: [https://modul-r.codekraft.it/test-form/](https://modul-r.codekraft.it/test-form/)
 * anyway you can create a custom [spam filter](https://contactform7.com/2020/07/18/custom-spam-filtering/)
   and check into
    $submission->get_meta( ‘current_user_id’ ) so you can return 
   a message to unlogged users
 *  Thread Starter [islp](https://wordpress.org/support/users/islp/)
 * (@islp)
 * [5 years ago](https://wordpress.org/support/topic/adding-warning-message-on-submit/#post-14472179)
 * [@codekraft](https://wordpress.org/support/users/codekraft/) : as I told you 
   before, people with cached web page can try to send the form even if they are
   not logged in anymore. Have you ever opened multiple tabs in your device browser?
   That’s what happens all the time: people send a form, they don’t close the browser
   tab, then they come back to that page by simply selecting the tab and the form
   is STILL there, even if they are not logged in anymore (eg. after a couple of
   weeks).
 * Thanks for the filter suggestion, I’ll give it a try.
 *  [Erik](https://wordpress.org/support/users/codekraft/)
 * (@codekraft)
 * [5 years ago](https://wordpress.org/support/topic/adding-warning-message-on-submit/#post-14472195)
 * when they send the form, the response to the request comes from the server, so
   it doesn’t matter if they still had the page open, they will see the spam filter’s
   response.
 *  Thread Starter [islp](https://wordpress.org/support/users/islp/)
 * (@islp)
 * [5 years ago](https://wordpress.org/support/topic/adding-warning-message-on-submit/#post-14472196)
 * I was replying to this one:
 * > yes but if you aren’t logged in you can’t submit the form (or better, you can’t
   > load the form)
 * The filter could work, anyway, even if I don’t know if the user receives some
   form of alert or warning (this is the important part: I should tell him to log
   in)
    -  This reply was modified 5 years ago by [islp](https://wordpress.org/support/users/islp/).
 *  [Erik](https://wordpress.org/support/users/codekraft/)
 * (@codekraft)
 * [5 years ago](https://wordpress.org/support/topic/adding-warning-message-on-submit/#post-14472205)
 * ciao [@islp](https://wordpress.org/support/users/islp/),
    yes but in that case
   you can add a location.reload() when the page has blurred for a while. Every 
   problem has its solution! 🙂
 *  Thread Starter [islp](https://wordpress.org/support/users/islp/)
 * (@islp)
 * [5 years ago](https://wordpress.org/support/topic/adding-warning-message-on-submit/#post-14472222)
 * This is the first solution I avoided (also, reloading doesn’t log in the user).
 * I’m actually building another thing: a widget (a box on the right sidebar) done
   with React controls every a couple of seconds if the user is logged in: if not
   it hides the form and displays a button that the user can click to go to the 
   login page. It could even use location.href, eventually, but I wanted to enforce
   the concept that the user must be logged in and so I request a “manual” intervention.

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

The topic ‘Adding warning message on submit’ is closed to new replies.

 * ![](https://ps.w.org/contact-form-7/assets/icon.svg?rev=2339255)
 * [Contact Form 7](https://wordpress.org/plugins/contact-form-7/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/contact-form-7/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/contact-form-7/)
 * [Active Topics](https://wordpress.org/support/plugin/contact-form-7/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/contact-form-7/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/contact-form-7/reviews/)

## Tags

 * [logged out](https://wordpress.org/support/topic-tag/logged-out/)
 * [submit](https://wordpress.org/support/topic-tag/submit/)

 * 8 replies
 * 2 participants
 * Last reply from: [islp](https://wordpress.org/support/users/islp/)
 * Last activity: [5 years ago](https://wordpress.org/support/topic/adding-warning-message-on-submit/#post-14472222)
 * Status: not resolved