vendredi 27 février 2015

HTML5 on iOS Form Validation for Numeric Only Input Field

I am designing a custom validation for an Input field that will accept only numbers with a period and 2 decimal places.


The user will only have access to the telephone keyboard.


The behaviour would be that the field initially contains a placeholder text but as soon as the user begins to enter numbers in the text would change to $0.01 where 1 is the first number they typed. As they continue typing numbers in I want to shift the number over as such:


$0.01 -> $0.12 -> $1.23 -> $12.34 and so on.


I'd like to avoid re-inventing the wheel if there is already a JavaScript library that could achieve this functionality.


Otherwise some idea's on how to build this would be greatly appreciated.


Aucun commentaire:

Enregistrer un commentaire