Drupal problem with HMTL5 support

♫ Hello strange Marillion, it's been a while since I made the heads of this old music hdd spin. 5 hours 17 min ago

First little disappointment with Drupal is that it does not allow HTML5 specific input types. This is how I tried to modify one input box in my contact form replacing attribute type="text" with type="email":

<?php
function f1init_form_alter(&$form$form_state$form_id) {
switch (
$form_id) {
    case 
'contact_mail_page':
        
//print_r($form);
        
$form['name']['#type'] = 'email';
    break;
}
?>

Unfortunately, result is bad. The object completely disappears from the page. Little investigation lands me in ~/includes/form.inc. Basically, there is now no way to override type="". Even less encouraging is the fact that Drupal 7 has the same issue, I am hopeful that will be fixed though; in the meantime, I will try to think of a solution.

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
seven - = five
Solve this math question and enter the solution with digits. E.g. for "two plus four = ?" enter "6".