Drupal problem with HMTL5 support

...and Boston traffic view http://t.co/eC7X4KKZ 2 days 2 hours ago

f1vlad last spotted in:

Nashua, New Hampshire

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.
+ eight = 16
Solve this math question and enter the solution with digits. E.g. for "two plus four = ?" enter "6".