Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1054175
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T17:21:53+00:00 2026-05-16T17:21:53+00:00

I have for example: (111) 222-3333 – Verizon … I want to when I

  • 0

I have for example: (111) 222-3333 – Verizon … I want to when I select this fill in two text box. The first textbox having (111) 222-333 and in the second textbox with Verizon. Is this possbile with jquery?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T17:21:54+00:00Added an answer on May 16, 2026 at 5:21 pm

    Sounds like the job for a regular expression:

    var text = "(111) 222-3333 - Verizon";
    var regexp = /(\(\d{3}\)\s\d{3}-\d{4}) - ([A-Za-z ]+)/;
    
    result = regexp.exec(text);
    if (result) {
        alert('Number: ' + result[1] + '\nCarrier: ' + result[2]);
    }
    else {
        alert('No match');
    }
    

    A bit of searching should turn up a more robust regular expressions to match phone numbers.

    Also – you can use jQuery to help you move the result values around, i.e., $('#number_text_box').text(result[1]);, but the regular expression is a javascript thing, it doesn’t depend on jQuery.


    Update: this expression adds capturing groups, ( ) around each individual part of the number.

    var regexp = /\((\d{3})\)\s(\d{3})-(\d{4}) - ([A-Za-z ]+)/;
    

    You can then glue the numbers together:

    var number = result[1] + result[2] + result[3];
    var carrier = result[4];
    

    A good place to experiment is in the browser itself – in Firebug or Webkit’s console, you can run javascript like this directly to test it out.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this array, for example (the size is variable): x = [1.111, 1.122,
I have example.org and foo.example.org pointing to the same directory, /var/www/html/ , and want
I have an example class containing two data points: public enum Sort { First,
For example, I have 3 counters (which I essentially want to represent as truth
I have this pseudo-code in java: bytes[] hash = MD5.hash(example); String hexString = toHexString(hash);
I have a one-dimensional array with (a example): { [Pagamento_valor_liquido]=> string(3) 111 [Pagamento_valor_bruto]=> string(3)
I have two similar table in database, for example: news1: id | title |
i have for example: $one = 'aaa bbb ccc sss ddd www'; $two =
I just started playing around with JSON and I have created this example. var
1) I have a data bag as follows: zookeeper:{ server1:111.111.111.111, server2:222.222.222.222 }, 2) In

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.