Thanks for replying. A small problem I ran into when emulating the html5 placeholder attribute is that emulating the behavior involves setting the input's value. A value that then has the chance of being submitted, if the value is never cleared by either the user focusing or binding a function to the submit event. So I was left with writing a custom deserialization method to check if the submitted value is equal to the placeholder value. Anyway, thanks again for replying.
On Aug 13, 12:09 pm, Jeff Dairiki <[email protected]> wrote: > On Fri, Aug 12, 2011 at 02:57:18PM -0700, Bobby wrote: > > The desired outcome is an input field filled with a default value that > > is removed when the field is focused. > > I haven't actually tried this yet (sorry), but I plan on just using the > HTML5 placeholder attribute. > > As far as deform is involved this would involved modifying the default > templates to set the 'placeholder' attribute on text input and textarea > tags. I think I'd make the template pull the placeholder value from > field.schema.placeholder. > > To support older browsers, I plan on using a bit of javascript to > emulate the HTML5 behavior. The modernizr wiki has a list of > "polyfills", several of which claim to do the job (scroll down to "Web > Forms - input placeholder"): > > https://github.com/Modernizr/Modernizr/wiki/HTML5-Cross-Browser-Polyf... > > Jeff -- You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en.
