• Resolved skirridsystems

    (@skirridsystems)


    Hi Guido,

    Another problem which I’ve seen intermittently. I fill in all the form fields, click submit, and get back the same form with all fields blank and an error message by each one saying e.g., please enter at lest 2 characters.

    I looked at the POST data and all fields seem to be filled in, so my only guess is that in the form validation the $rand_suffix value doesn’t match for some reason. I’m using the Siteground caching plugin and if I exclude the page from caching then form submission seems to work OK.

    I can see that the suffix is handled using a transient but I’m not exactly sure how it works and it seems quite complicated.

    Looking at other contact forms I can see they don’t do this. There is an ID for the form, 1 for the first form, 2 for the second, etc. in case you have more than one on a page, but no random component. I’ve done something similar myself for a maps plugin, adding a suffix to differentiate between maps on the same page.

    Do you actually need the random suffix as it seems to introduce other problems?

    Simon

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Guido

    (@guido07111975)

    Hi Simon,

    Caching causes this I guess. I’ve added a transient recently that holds the sum values. These values are also being used for a prefix for form and field ID. They change upon successful submission. This way you cannot resubmit form over and over again, or go back (via back button) to filled in form after successful submission

    It’s strange that caching is causing this, because I’m using a native WP feature (transient). Which plugin are you using?

    Guido

    Plugin Author Guido

    (@guido07111975)

    Which plugin are you using?

    Sorry, you mention Siteground. Do you mean the Speed Optimizer plugin perhaps?

    It’s strange that caching is causing this

    I guess the prefix of form and fields doesn’t change after submission? This means cache is using the “old” version of form.

    Guido

    Thread Starter skirridsystems

    (@skirridsystems)

    Yes, it’s that plugin. I know I have to disable caching for any page which uses VS Event List and I was hoping not to have to do that for contact forms too.

    Simon

    Plugin Author Guido

    (@guido07111975)

    Hi Simon,

    I will install this plugin and start testing.. Will keep you informed.
    But I think many other plugins that display non-static content run into this issue. Or do you have an example of a form plugin that works fine with caching enabled? Maybe I can learn from it..

    And thank you for your patience, and for investigating it.
    You may think this form plugin is quite simple, but because you can abuse a form in many ways, I had to include all kinds of security related features. That’s the reason for the random form and field name prefix and the use of transients to temporary store sum data.

    Guido

    Plugin Author Guido

    (@guido07111975)

    Hi again,

    Just installed Speed Optimizer, but I cannot activate Dynamic Caching and Memcached, because I’m not on Siteground environment.
    But it seems that the File-Based Caching is causing this.

    As I already mentioned in a previous reply: This means cache is using the “old” version of form.
    It returns a form with the old prefix. For now only solution is to exclude this page from caching. The validation of other plugins is often JS based. My plugin needs a new pageload to process and validate data. That’s causing this cache issue.

    Guido

    Thread Starter skirridsystems

    (@skirridsystems)

    OK, understood. I’ll disable caching for that page.

    Plugin Author Guido

    (@guido07111975)

    Hi Simon,

    Unfortunately I cannot fix this easily, other plugins use JS/AJAX for form processing. My plugin depends on the default PHP page reload, and with caching enabled the cached version of that page is being returned. Until I have a solid solution/fix I will add some info about caching in the readme file.

    Guido

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

The topic ‘Please enter at least 2 characters’ is closed to new replies.