[SalesForce] HTML5 input type number for decimals

I have created a SalesForce1 app for my organizations.

It is working fine and I used internet to help me go through all the customization.

I would like the inputs to be managed by HTML5 to make the users' life easier.

I was able to display a date selector for date fields on smartphones/tablets but I cant do the same for decimal fields (currency).

For the date

apex:inputField type="date" value="{!s.Date_6__c}"/

=> Working

For the decimal

apex:inputField type="number" value="{!s.Amount_6__c}"

=> Error: Input type 'number' does not support Decimal data type. Try settng type to 'text'

I saw workarounds based on hidden fields but i'd rather have a real solution if possible..

Best Answer

<apex:page standardController="Object" doctype="html-5.0">
<apex:input type="Number" html-step="any" Value="yourValue"/>
</apex:page>

Be sure to specify doctype="html-5.0" and the html-step="any" in order to have decimals in the html number input.

Related Topic