I do not know that is an other way in D7 or not but I needed to using this on a D7 project.
Please check it. I was made some changes and it work properly on D7 now.
This is already posible if you use the elements modules for both 6.x and 7.x
who knew ?!? ... I've used elements on a few sites already, just never realized it added support for #placeholder.
I suppose this module still works for browsers that dont support #placeholder yet ... but in light of this revelation, I dont think I'll bother porting it to D7
Thanks, I will using elements module in future.
Why not just use #attributes['placeholder'] directly? Works for me without Elements.
Drupal is a registered trademark of Dries Buytaert.