My problem with this method has always been the potential for form data pollution. Element.toQueryString and regular from submissions can send that placeholder data to the server. Yes, JS can remove this stuff on submit, but it's still error prone IMHO.
On Nov 21, 2011, at 8:01 AM, Olmo Maldonado <[email protected]> wrote: Perhaps toning down the criticism to a few pointers on how to improve style and code might be even more constructive. For example your points could be rephrased: Instead of using getElementsByTagName('*') you should use $$('input, textarea'). On Mon, Nov 21, 2011 at 9:00 AM, Arieh Glazer <[email protected]>wrote: > Nicer solutions - http://mootools.net/forge/p/mootools_placeholder > > > On Mon, Nov 21, 2011 at 4:53 PM, Arieh Glazer <[email protected]>wrote: > >> This is far from a good implementation (at least the vanilla >> implementation) - eg- it has the following bit: >> >> var elems = document.getElementsByTagName("*"), >> n = elems.length; >> for(var i=0;i<n;i++){ >> if(elems[i].nodeName.toLowerCase() == 'input' || elems[i]. >> nodeName.toLowerCase() == 'textarea') { >> >> >> now - that's plain wrong (eg solution = getElementsByTagName('input'), >> getElementsByTagName('textarea') - send both to an iterate function. >> >> Also - it lacks support for styling, since it simply replaces the value >> >> >> On Mon, Nov 21, 2011 at 4:16 PM, Adrian Statescu <[email protected]>wrote: >> >>> Brings HTML5 placeholder attribute into all modern browsers. >>> >>> Check this out: https://github.com/thinkphp/placeholder.js >>> >>> cheers! >>> >> >> >> >> -- >> Arieh Glazer >> אריה גלזר >> 052-5348-561 >> http://www.arieh.co.il >> http://www.link-wd.co.il >> >> > > > -- > Arieh Glazer > אריה גלזר > 052-5348-561 > http://www.arieh.co.il > http://www.link-wd.co.il > >
