WordPress.org

Ready to get started?Download WordPress

Forums

Contact Form 7
text field and text area watermark not working (9 posts)

  1. centinel3
    Member
    Posted 3 years ago #

    I am having trouble getting the watermark to work properly, or perhaps I'm not fully understanding the 'watermark' feature. I'm thinking that if the textfield is using the watermark feature as soon as the user clicks the field the default text value disappears so they don't have to delete the default value before typing in their email, or name.

    If this is not what the 'watermark' feature is can someone explain it to me?

    Also, if anyone knows how to configure the text fields to have a default value that disappears when a user clicks into the box, please let me know. I have been looking around and don't see how to do so.

    Thank you for your help and look forward to hearing from you.

    Sincerely,
    Chris

  2. Takayuki Miyoshi
    Member
    Plugin Author

    Posted 3 years ago #

    Watermark shows description of field. It's different from default value.

    Also, if anyone knows how to configure the text fields to have a default value that disappears when a user clicks into the box, please let me know. I have been looking around and don't see how to do so.

    It's impossible. Because if it disappears when user clicks, it can't work as a default value.

  3. centinel3
    Member
    Posted 3 years ago #

    You can have a default value disappear when a user clicks in the box. Look at any common search field that displays 'search' in teh text area. When you click into it you don't ahve to remove the text, it just disappears.

    The code below will do exactly what I'm looking to do with Contact Form 7, thoguh am not sure where to implement this in the template itself. Any help would be appreciated.

    <input type="text" name="ea" id="ea" size="20" value="Enter E-mail Address" onfocus="if(this.value==this.defaultValue) this.value='';" onblur="if(this.value=='') this.value=this.defaultValue;" />

  4. Takayuki Miyoshi
    Member
    Plugin Author

    Posted 3 years ago #

    "Default value" is a text which will be submitted to the server when you don't change it. It does not disappear, because if it disappears it can't be submitted.

    What you wish is "watermark". Watermark is a text which disappears when the field has focus. "Default value" and "watermark" are different things.

    If you have set watermark option as the doc tells and it doesn't work, maybe javascript is not working on your site or having errors.

  5. centinel3
    Member
    Posted 3 years ago #

    I have tried various ways to get that 'watermark' to work and nothing seems to work properly. javascript is turned on.

  6. merlin.ward@gmail.com
    Member
    Posted 3 years ago #

    I'm having this same issue. The watermark feature is great, but it's not working. I notice that in your text field "class" the form puts "wpcf7-use-title-as-watermark". I can't seem to find that in the code when editing the plugin. Even as a class though, I've never heard of a way of using javascript in the CSS style sheets <- disregard you're connecting the watermark value in another way.

  7. bbruno
    Member
    Posted 3 years ago #

    Did anyone figure this out?

  8. bbruno
    Member
    Posted 3 years ago #

    Ok. figured my problem out. You need to make sure you are calling the wp_footer in your footer.php file.

    <?php
    	/* Always have wp_footer() just before the closing </body>
    	 * tag of your theme, or you will break many plugins, which
    	 * generally use this hook to reference JavaScript files.
    	 */
    
    	wp_footer();
    ?>
  9. yojishiraki
    Member
    Posted 3 years ago #

    Every plugin need some javascript or stylesheet. And they are called by tag , wp_head() whitch is stated in header section. Make sure your header section.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic