jyu.z3cform.placeholder 1.0b3
Integrates jQuery Watermark for z3c.form on Plone.
jQuery Placeholder
Integrates jQuery Watermark for z3c.form on Plone by
- registering jquery.watermark's JavaScript and CSS
- introducing ''placeholder''-directive to be used in schemas
- registering value adapter to for annotated placeholder value
- 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
| File | Type | Py Version | Uploaded on | Size | # downloads |
|---|---|---|---|---|---|
| jyu.z3cform.placeholder-1.0b3.zip (md5) | Source | 2011-02-23 | 13KB | 292 | |
- Author: Asko Soukka
- Home Page: http://pypi.python.org/pypi/jyu.z3cform.placeholder
- License: GPL
- Categories
- Package Index Owner: datakurre
- DOAP record: jyu.z3cform.placeholder-1.0b3.xml
