WordPress.org

Ready to get started?Download WordPress

Forums

MailChimp Widget
[resolved] Text in input field (3 posts)

  1. djzero23
    Member
    Posted 2 years ago #

    Just wondering if it is possible to add text into the input fields and have it disappear when someone clicks into the field. i.e. put the label text (I've heard it called "hint") in the input field.

    http://wordpress.org/extend/plugins/mailchimp-widget/

  2. jameslafferty
    Member
    Plugin Author

    Posted 2 years ago #

    Hi djzero23,

    Thanks for trying out the plugin. The way to do this is by using some fairly simple Javascript, although the particulars will depend on where/how you're deploying it.

    Using jQuery (which is already loaded in for the widget plugin), the js would be something like this:

    jQuery(function ($) {
        $('input[name="ns_widget_mailchimp_email"]').val('Email');
        $('input[name="ns_widget_mailchimp_email"]').focus(function () {
            $(this).val('');
        });
    });

    Where it's best to put that JS is even more dependent upon your implementation and exact requirements.

    Hope that helps!

    J.

  3. djzero23
    Member
    Posted 2 years ago #

    Thanks so much for your reply James. I will def try it out.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic