phone-number

Regex to allow only digits, hypens, space, parentheses and should end with a digit (javascript) [duplicate]

北慕城南 提交于 2019-12-05 12:46:47
This question already has answers here : Closed 7 years ago . Possible Duplicate: US Phone Number Verification I need to validate US phone number. It could be in the format: xxx-xxx-xxxx (xxx) xxx xxxx (xxx)-xxx-xxxx xxxxxxxxxx but it should not be xxx-xxx-xxxx- -xxx-xxx-xxxx It should accept digits, hyphens, space and parentheses. Currently I use ^\[0-9 \-\. ]+$ which does not validate dash at the beginning or end. staafl ^\(?\d{3}\)?[- ]?\d{3}[- ]?\d{4}$ Eugene Well my idea is (after some searching) not new at all! Look at this: A comprehensive regex for phone number validation This is an

parsley.js telephone digits input validating with spaces

别说谁变了你拦得住时间么 提交于 2019-12-05 07:19:18
I have an input for telephone number. I would like to write this format: 0175 6565 6262 (with spaces). But if write with " " spaces so get error and I write without spaces so get not error. Here my HTML Input: <input type="text" data-parsley-minlength="6" data-parsley-minlength-message="minlength six number" data-parsley-type="digits" data-parsley-type-message="only numbers" class="input_text" value=""> Hope someone can help me? That's a great answer, but it's a bit too narrow for my needs. Input field should be tolerant of all potential inputs – periods, hyphens, parentheses, spaces in

Automatically format phone number in EditText

穿精又带淫゛_ 提交于 2019-12-05 01:20:26
In my app, the user has to enter a phone number in an EditText field using the following format: 1(515)555-5555 I don't want the user to type "(", ")", or "-" while entering the number; I want these characters to be added automatically. For example, suppose the user typed 1 -- the parenthesis after "1" should be added automatically, so that "1(" would be displayed. And I would like to have similar functionality while deleting. I have tried to set text in the afterTextChanged method of onTextWatcher interface, but it is not working; instead it's causing an error. Any help will be greatly

How to show both texting and dialer apps with a single Intent on Android?

﹥>﹥吖頭↗ 提交于 2019-12-04 19:44:27
From my app, the user can text/call a person. I am starting an Activity through Intent in my app, currently 1 for texting and 1 for the dialer, is it possible to combine these, e.g. so when user clicks a button to call/text it brings up a list of texting/dialer apps in 1 window ? Dialer: Intent callIntent = new Intent(Intent.ACTION_CALL); callIntent.setData(Uri.parse("tel:" + somenumber)); startActivity(callIntent); Messaging app: Intent callIntent = new Intent(Intent.ACTION_PROCESS_TEXT); callIntent.setData(Uri.parse("tel:" + somenumber)); startActivity(callIntent); What I want to do is,

Using PhoneNumberFormattingTextWatcher without typing country calling code

北慕城南 提交于 2019-12-04 17:11:25
In the login panel of my app, I divided the country calling code and the remaining numbers in two editable TextView as below: I want to use international formatting standard in the TextView on the right. If a user who has a phone number as +905444444444 types in number in these boxes, I want to see "90" in the box on the left and "544 444 4444" on the right. For this reason, I tried to use the following implementation that uses libphonenumber: /** * Watches a {@link android.widget.TextView} and if a phone number is entered * will format it. * <p> * Stop formatting when the user * <ul> * <li

Get a single phone number from contacts Android

允我心安 提交于 2019-12-04 14:38:43
Hi I am trying to get a single phone number from the contact list . I have found code which gets me the whole contact list telephone numbers, all I want is the telephone number for the item clicked. Any Help would be gratefully appreciated . Thanks .. public void onClick(View v) { Intent contactPickerIntent = new Intent(Intent.ACTION_PICK,Contacts.CONTENT_URI); startActivityForResult(contactPickerIntent,CONTACT_PICKER_RESULT); ContentResolver cr = getActivity().getContentResolver(); Cursor cur = cr.query(ContactsContract.Contacts.CONTENT_URI, null, null,null, null); if (cur.getCount() > 0) {

“tel:” URLs lead to error page on non-mobile browsers

こ雲淡風輕ζ 提交于 2019-12-04 14:18:31
问题 On this site, I have a link to a phone number for mobile devices in the top right corner where the mobile number is displayed. On desktops, when clicking on this link Chrome just ignores the link but firefox and internet explorer redirect to an error page. HTML: <a href="tel:+491796737741" class="contact-info" ></a> CSS: #header .contact-info { width: 293px; height: 133px; display: block; float: right; cursor: pointer; background: url(contact-info.png) 0 0 no-repeat transparent; margin-right:

Paypal Express Checkout insists on phone number even though option turned off (calling from Magento)

依然范特西╮ 提交于 2019-12-04 06:19:04
I'm using the Paypal 'Express Checkout' option in Magento. (I'm not using any express checkout buttons, it's just because I was having problem with returning from Website Payments Standard). In Paypal's Website Payment Preferences, I've set the 'Contact Telephone Number' field to off. I've also made a number of changes on the Magento side to make telephone number optional (as per this post ). However, the telephone number field still appears during Paypal checkout, and is mandatory. Obviously, this is potentially going to cause customers to abandon the transaction. Initial response from Paypal

Phone number format in Javascript

夙愿已清 提交于 2019-12-04 06:00:57
问题 I need to check Format Phone Number. +33xxxxxxxxx 0033xxxxxxxxx EDIT : 0xxxxxxxxx How can I do that with(out) regex ? 回答1: if (/^(?:(?:\+|00)33|0)\d{9}$/.test(subject)) { // Successful match } else { // Match attempt failed } 回答2: The regex to match it would be this (0033|\+33|0)?\d{9} I use http://regexpal.com/ for quick regex testing 回答3: PhoneFormat.com has a javascript library that has some formatting functions that you could easily drop into your project. It will take whatever number you

Get phone number of present incoming and outgoing call

£可爱£侵袭症+ 提交于 2019-12-04 01:36:34
问题 I am making an app in which I have to retrieve the phone number and I am able to retrieve it but my problem is that I am getting phone number of last call rather than present call .My code is as follows: projection = new String[]{Calls.NUMBER}; cur = context.getContentResolver().query(Calls.CONTENT_URI, projection, null, null, null); cur.requery(); numberColumn = cur.getColumnIndex(Calls.NUMBER); cur.requery(); cur.requery(); cur.requery(); cur.requery(); cur.moveToLast(); s = cur.getString