• Hello,
    I’m using WPCF7 for simple email signups. The form only has 4 fields: first, last, email, and and zip code; and all are required. In spite of the asterisks on all of the text fields, the form can be submitted with only an email address. If submitted entirely empty, only the email address will reliably return an error – and even then, the error is the invalid address one, not the required field.

    Code is very standard:

    [text* firstname placeholder "First Name"]
    [text* lastname placeholder "Last Name"]
    [email* email placeholder "Email Address"]
    [text* zip placeholder "Zip Code"]

    https://wordpress.org/plugins/contact-form-7/

Viewing 9 replies - 1 through 9 (of 9 total)
  • What version of CF7? Can you share the URL?

    Thread Starter pq

    (@pq)

    WP 4.0
    WPCF7 3.9.3

    http://wearenewmexico.org/

    There are two identical forms on the page; I created separate wpcf7 forms so that they would not cross-validate.

    I cannot post without all 4 forms filled out.

    Thread Starter pq

    (@pq)

    Hm, seeing your post, I thought, “Maybe it’s submitting b/c I’m logged in?” So I logged out of the back end, refreshed the page, entered ONLY an email address, and got sent right to the thank you page.

    Aha! Yes, I’ve had that issue before.

    Be sure to mark this as resolved!

    Thread Starter pq

    (@pq)

    Maybe I was unclear – the form accepted three empty required fields. This is not resolved yet…

    Ah, hm. Interesting. Do you have any JS errors?

    I’m not able to submit the form.

    See: http://imgur.com/Dkhp1Ca,XB8UmK0,FhHqkwO,nRisMrz

    These are the steps I took.

    Thread Starter pq

    (@pq)

    Nope, not getting any js errors.

    The screen shot you posted is what happens with an empty *email* field. Notice that the message is not saying, “Hey this field is empty,” it’s just hollering that it’s not a valid email address.

    The problem I’m having is that if a user enters a valid email address but nothing else, the form will submit. The text fields do not validate as required; and as far as I can tell, the email field is not validating as required, either; its validation seems to be only for correct format.

    Thread Starter pq

    (@pq)

    I’m also using the database extension for the plugin, and checking the list of submissions, it’s clear that the form is accepting the placeholder text as a form field value.

    Checking the generated code, I can see that the values of the text fields are, in fact, empty:

    <input type="text" name="firstname" value="" size="40" class="wpcf7-form-control wpcf7-text wpcf7-validates-as-required" aria-required="true" aria-invalid="false" placeholder="First Name" />

    – but the db list shows that the above field gets submitted with a value of “First Name.” Is there something additional that one needs to do in order to tell the form validation script that a placeholder value is not a form field value?

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

The topic ‘Form submits with empty required text fields’ is closed to new replies.