• 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)
  • is the subscriber mode good for your purpose?

    https://contactform7.com/additional-settings/#subscribers-only-mode

    Thread Starter islp

    (@islp)

    @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.

    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/

    anyway you can create a custom spam filter and check into
    $submission->get_meta( ‘current_user_id’ ) so you can return a message to unlogged users

    Thread Starter islp

    (@islp)

    @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.

    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

    (@islp)

    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 3 years, 6 months ago by islp.

    ciao @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

    (@islp)

    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.