Adding HTML5 placeholder to all drupal forms
Because I'm using the webform module I could just theme the global webform template (webform-form.tpl.php) and put it in my theme folder. No need to complicate things with a module.

foreach ($form["submitted"] as $key =&gt; $value) {
    if ("textfield" == $value["#type"]) {
        $form["submitted"][$key]['#attributes']["placeholder"] = t($value["#title"]);
    } 
}


I put this at the top of the template file.