0

I need make input field that contain phone numbers. Users can enter 1-10 numbers. I found almost suitable jQuery plugin. But it's searching from pre-existed datas. In my case there aren't any existed database. Users just fill numbers and commas. For example:

99889966, 88554477, 89879856 etc.

Please look below url and suggest me similar plugin which comfortable with my case.

http://loopj.com/jquery-tokeninput/demo.html

2
  • I think this is a bit off topic. Why not use one of the many validation plugins around? : google.lk/… Commented Apr 25, 2011 at 5:15
  • Because it's not about validation. It's more about StackOverflow's tag. You know while asking question, we enter tags. After press "space", works automaticaly enter below field. I'm looking for plugin like that. Commented Apr 25, 2011 at 5:53

2 Answers 2

2

check out:

http://digitalbush.com/projects/masked-input-plugin/

Sign up to request clarification or add additional context in comments.

1 Comment

I don't looking for validation. English is not my nature language. Maybe I described wrong. I'm looking for custom input, that enters texts like facebook and stackoverflow's tag.
0

Or you can simply use this code.

$("#txtPhNo").keypress(function (event) {
// 32 - Space, 44 - comma, between 47 to 59 are numbers
if (event.which != 32 && event.which != 44 && (event.which < 47 || event.which > 59)) {
event.preventDefault();
}
}); 

This code is very basic. You can do more tricks by adding features to this.

1 Comment

It's almost what I wanted. But is there any ready for use jQuery plugins?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.