Skip to main content

Integrates jQuery Watermark for z3c.form on Plone.

Project description

jQuery Placeholder

Integrates jQuery Watermark for z3c.form on Plone by

  1. registering jquery.watermark’s JavaScript and CSS

  2. introducing ‘’placeholder’’-directive to be used in schemas

  3. registering value adapter to for annotated placeholder value

  4. registering custom JavaScript to initialize watermarks

I wonder, if this product should’ve been named ‘’formwidget’’-something…

Example of Use

from zope import schema

from plone.directives import form

from jyu.z3cform.placeholder.directives import placeholder

from zope.i18nmessageid import MessageFactory as ZopeMessageFactory
_ = ZopeMessageFactory("my.domain")

class MyForm(form.Schema):
    """An example form
    """
    placeholder(subject=_u("Type something here.."))
    subject = schema.TextLine(
      title=_(u"Subject"),
      description=_("Subject of this submission"),
      required=True,
      )

Overlay Support

When you register custom form overlays in your custom JavaScript, you’d like to include placeholder support in your JavaScript like:

$(document).ready(function() {
  $($('#my-form-link').prepOverlay({
    subtype: 'ajax',
    cssclass: 'content',
    formSelector: 'form',
    width: '40em',
  }).attr("rel")).bind("onLoad", function() {
    $(this).find("form .field").placeholder_z3cform();
  });
});

Changelog

1.0b3 - 2011-02-23

  • Disabled textarea placeholder due to problems with TinyMCE’s textarea.

1.0b2 - 2011-01-25

  • Replaced $ global with jQuery, because KSS’ effects-plugin steals $ on IE.

1.0b1 - 2010-12-15

  • Initial release

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jyu.z3cform.placeholder-1.0b3.zip (14.3 kB view details)

Uploaded Source

File details

Details for the file jyu.z3cform.placeholder-1.0b3.zip.

File metadata

File hashes

Hashes for jyu.z3cform.placeholder-1.0b3.zip
Algorithm Hash digest
SHA256 ace52f9b5dac25484124ef2e7da8990b07459330de2c1d97a967b45acfe1aedc
MD5 adad868ef7d322c41fea18d8f6e43351
BLAKE2b-256 e2ca9c42cb0a1cce328e9b440ca6a727c87de0ac313480f10092805be3e0e1b5

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page