June 30, 2014

Cancelling out of HTML5 browser validations !

This post is based on a short scary movie, I was working on a cool HTML-5 page

 <apex:page .... docType="html-5.0"/>


But all the coolness disappeared when powers of CANCEL button are gone. The typical Cancel button in salesforce, which is always tough enough to get out of any validation, i.e.

<apex:commandButton action="{!cancel}" value="Cancel" 
immediate="true" />


On hitting the cancel button like this, HTML5 and browser acted smart and ruined all the fun, i.e. got following error: