• Resolved gamepres

    (@gamepres)


    I found a validation bug using the hidden field with an email address.
    The field is used on a page where the user is logged in, so the field retrieve his email address:
    [hidden your-email default:user_email]
    Then this email address is set for reply in Additional Headers:
    Reply-To: [your-email]

    Unfortunately I get a validation error telling me that “There are invalid mail header fields.”

    The same form exists for guests with the following difference:
    [email* your-email 32/64 default:user_email placeholder “hanako@mail.com”] in place of the hidden field.
    I have no error with this form.

    Would it be possible for Contact Form 7 to treat a hidden field as a correct email address?

    Thank you very much for your fantastic plugin.

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Takayuki Miyoshi

    (@takayukister)

    No, it’s impossible because anyone can alter the field value.

    Thread Starter gamepres

    (@gamepres)

    Thank you for your quick reply.

    In case the field is [hidden your-email default:user_email], the field is not visible and the email address is always the visitor’s registered email address.
    So I feel using the default:user_mail should be treated as a legitimate and unmodified field.

    Thread Starter gamepres

    (@gamepres)

    What if the “subscribers_only: true” is activated?
    Maybe this would be a good compromise to say there’s no need to show an error when using default:user_mail as the reply mail?
    What do you think?

    Plugin Author Takayuki Miyoshi

    (@takayukister)

    Even if it’s in the subscribers-only mode, logged-in users can modify the value.

    Why don’t you use email* tag instead and simply hide it with CSS?

    Thread Starter gamepres

    (@gamepres)

    Thank you for your kind feedback. Following your advice, I’m trying to hide the email field using CSS.
    But I am still a bit confused, as I thought the [hidden] tag were useful to hide fields from the user.
    May I ask a very simple question?
    If the field is hidden, how can the user can still modify the value while using the form?
    Thank you in advance.

    Plugin Author Takayuki Miyoshi

    (@takayukister)

    It’s just that your browser makes hidden fields invisible from you. Browser can see it and of course modify it. And you can interrupt the browser in the middle of communication with the server.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Hidden field and validation error’ is closed to new replies.