function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
nishad basha 7nishad basha 7 

Visualforce: apex:inputText - restrict input to numbers only

when i enter that mobile number that sholud be a number like that  but iam given text that showing error. How to solve the above scenario please give some ideas.
anand k 11anand k 11
Hi Nishad,

One way you could make this work is HTML5-ifying your Visualforce page and use <apex:input type="number" /> instead of apex:inputText.

https://developer.salesforce.com/forums?id=906F00000008mf8IAA

This can be done easily with Javascript also.
http://salesforce.stackexchange.com/questions/31641/visualforce-apexinputtext-restrict-input-to-numbers-only


Thanks
Anand
Francisco RojasFrancisco Rojas
So much thanks anand k 11 you rocks, it was so f**king useful