• Resolved tomicakorac

    (@tomicakorac)


    I’m experiencing a problem with placeholder text. All of my fields set to be required. All the fields also have placeholders. My problem is, even if a visitor does not fill in any of the fields, that field’s placeholder gets submitted as the field’s value, and the submission looks something like:

    Name: Name*
    Email: Email*
    Website: Website*
    Message: Message*

    The same problem also exists if I set watermarks instead of placeholders. I’ve tried debugging this, with no luck…

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

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

    (@takayukister)

    Try switching to the default theme.

    Thread Starter tomicakorac

    (@tomicakorac)

    I’m afraid I’m not able to, since it’s a live website. Why do you think switching to the default theme would help?

    Plugin Author Takayuki Miyoshi

    (@takayukister)

    Because I often see similar issues. They are caused by JavaScript in their theme.

    Thread Starter tomicakorac

    (@tomicakorac)

    Well I guessed it could have something to do with JavaScript, but I don’t think I could change the entire theme of a live site to resolve this issue. Takayuki, since you say you often see similar issues, can you please provide some links to their solutions, so that I can further track down the root?

    Thread Starter tomicakorac

    (@tomicakorac)

    I’ve found the fix. The problem was indeed in the theme’s ‘cusotm.js’ file:

    $('input[type="text"]').each(function () {
            var $me = $(this),
    	    DefaultVal = $me.attr('placeholder');
    
    	});

    By commenting that out, validation works as expected.

    Takayuki, thank you for pointing me in the right direction.

    Thread Starter tomicakorac

    (@tomicakorac)

    Sorry, forgot to mark the topic as resolved.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Placeholder text gets submitted’ is closed to new replies.