Format EditText view for phone numbers

后端 未结 8 1822
既然无缘
既然无缘 2020-12-28 20:49

I have an EditText view and I want it to format the user\'s input into the phone number format. For example, when the user types in 1234567890, the EditText view should dyna

8条回答
  •  情深已故
    2020-12-28 20:59

    You could either do this with JQuery validate (onkeyup event) so you could do dynamic formatting as they type (jarring experience there to contemplate) - or you could do it with a MVVM library such as RAZOR or KnockoutJS (as they exit the field).

    Examples of what you want to do are both on the JQuery Validate documentation site, as well as the knockout JS site.

提交回复
热议问题