Skip to main content

HTML5

Clearing textfield in drupal

Adding a clear button to Drupal form API text field

We wanted to have a quick clear button for any text field (similar to address bar of browsers in mobile and tablet devices). Snapshot below might explain it much better. In this you are seeing email search field in newsletter filter form.

While I was in search for creating this, I found HTML5 is as the way to go. One can simply create that by using "search" input type. The proper HTML tag for the same is below,

manifest cache

Cache manifest in drupal

This blog gives you an understanding about cache manifest in Drupal. Cache manifest is used to cache pages in local server to use it when there is no network connection. This can be easily done by adding attribute "manifest="filename.appcache" to the HTML tag as mentioned below:

Add Placeholders

Add Placeholders to Captcha input field

HTML 5 has been encompassed with many novel attributes, one of which is the Placeholders. The Placeholder attribute displays text in the input field till it is focused and then hides the text on click. These Placeholders plays an momentous role in offering a visual information about the field. A general place where I prefer to add Placeholders is template.php in your theme. 

Subscribe to HTML5