Contact Form 7
Add default value AND watermark? (8 posts)

  1. kloooty
    Posted 5 years ago #

    Hey there,

    I was wondering whether it is possible to add a default value for a text field, use it as a watermark but still have it being used for the value="" tag.

    The problem here is, if javascript is disabled, the value won't show up. Since I'm only using the values as labels, this kinda sucks.

    Anyone got an idea for that?

    Thanks & all the best


  2. kloooty
    Posted 5 years ago #

    no clue anyone? :(

  3. Takayuki Miyoshi
    Plugin Author

    Posted 5 years ago #

    Not a bad idea.

  4. kloooty
    Posted 5 years ago #

    i know, but how to be done? ;-)

  5. kloooty
    Posted 5 years ago #


    Would be great if anyone came up with something ...

  6. kloooty
    Posted 5 years ago #


  7. superscott597
    Posted 5 years ago #

    I ran into (hopefully) the same problem. It appears that the order of declarations is important. I have a little JS script to unpopulate value="Name" on focus and to repopulate value="" if there is no other value in it. That way it acts a s a label.

    If this is kinda what you're talking about, try this code:

    [text* your-name class:name "Name"]

    [text* your-phone class:phone "Phone"]

    [text* your-email class:email "Email Address"]

    [submit class:submit "Submit"]

    The order is [input-type input-name class(optional) "value"(optional)]

    I hope this helps. It's crazy that they didn't think to include basic instructions for how to put in a freaking default value. Anyway, I hope I understood what you were looking for and that this was what you were trying to do.


  8. superscott597
    Posted 5 years ago #

    P.S. kloooty, I used inline labels for a while, but it proved much easier to just use JQuery to pinpoint the input class and remove the default value when they focus the field. Too much styling had to be done with the labels, so I went looking for some other way to have inline labels. Just tryin to make your life easier, please don't hate me. :)

    EDIT: Never mind that, ran into other problems with the default value format that make inline labels more reliable. :)

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Contact Form 7
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic