WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. kloooty
    Member
    Posted 3 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
    klooty

    http://wordpress.org/extend/plugins/contact-form-7/

  2. kloooty
    Member
    Posted 3 years ago #

    no clue anyone? :(

  3. Takayuki Miyoshi
    Member
    Plugin Author

    Posted 3 years ago #

    Not a bad idea.

  4. kloooty
    Member
    Posted 3 years ago #

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

  5. kloooty
    Member
    Posted 3 years ago #

    *push*

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

  6. kloooty
    Member
    Posted 3 years ago #

    :(

  7. superscott597
    Member
    Posted 3 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.

    -Scott

  8. superscott597
    Member
    Posted 3 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

About this Topic