WordPress.org

Ready to get started?Download WordPress

Forums

Contact Form 7
OnFocus? (4 posts)

  1. Nicholas Scalice
    Member
    Posted 3 years ago #

    Hi, is it possible to implement an OnFocus effect with Contact Form 7 so that fields are pre-populated and the text vanishes when users click on them?

  2. flamenco
    Member
    Posted 3 years ago #

    Yes, and you could do it two ways. Dig into Contact Form 7's code, and hard-code it there.

    Or you could do it with Javascript alone, which would be entirely independent of Contact Form 7's code. I like using this method when working on systems where the infrastructure makes it impossible or wretchedly difficult to get into the system code (like Joomla, for instance). So for instance, you could write validation code that sits on top of the site, so to speak.

    But is there an instant way to do this? No. Some Javascript coding ability required.

  3. schmaart
    Member
    Posted 3 years ago #

    Solution in forums here

    ...only works for input type="text".

    I'll post again when I find the equivalent for textarea

  4. schmaart
    Member
    Posted 3 years ago #

    Full solution for text and textarea here

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic