PDA

View Full Version : How to remove Hyphen(-) characters while pasting a mobile number?



varmaj80
14 Apr 2015, 6:57 AM
Hi all,

I have a mobile number text field which accepts only numbers(vtype: 'number'). The max length for this field is 10 characters. When I type a number say, 123-456-7890 it will not allow me to type the '-' and allows only numbers which is perfect. But when I try to paste a number, say 123-456-7890 into the field, it allows the '-' character and removes the last two digits in the number because of the maxlength. Is there a way, I can strip off the special characters while pasting and allow only digits into the field?.

Thanks,

tristan.lee
16 Apr 2015, 11:54 AM
Hi,

It sounds like you are using a text field with a custom number VType. Can you provide a code example either inline or at https://fiddle.sencha.com to further troubleshoot your issue?

Thanks,
Tristan