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 6556059
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T12:53:44+00:00 2026-05-25T12:53:44+00:00

If I have three text input and I want to combine the values in

  • 0

If I have three text input and I want to combine the values in these three text input into one POST name, how can I do that?

UPDATE:

a good example would be if I have a phone number field, and I have three fields for the phone number… I wanted this to be posted as one so back in the server side I can just access it as $POST[‘phone’]

Would be nice if something like jQuery can help me out here.

  • 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-25T12:53:45+00:00Added an answer on May 25, 2026 at 12:53 pm

    Have them as an array:

    <input type="text" name="inputs[]" />
    <input type="text" name="inputs[]" />
    <input type="text" name="inputs[]" />
    

    Then you can access them in the POST array.

    You have not indicated the programming language, but in PHP it would be, $_POST['inputs'][0], $_POST['inputs'][1], $_POST['inputs'][2]…


    Since you want to have only one phone input which contains the full phone number appear on server side, not parts of it, and you are using jQuery in your project, this will make things easy for you:

    1. Sample Markup

    <form id="my_form" method="post">
        <input type="text" name="phones[]" />
        <input type="text" name="phones[]" />
        <input type="text" name="phones[]" />
        <input type="hidden" name="phone" />
        <input type="submit" name="send" value="Send It" />
    </form>
    

    2. jQuery

    $(document).ready(function(){
        var $phones = $('#my_form input[name="phones[]"]'),
            $phone = $('#my_form input[name="phone"]');
    
        $('#my_form').submit(function(){
            // join all the phone parts together
            var phone_number = '';
            $phones.each(function(){
                phone_number += this.value;
            });
    
            // change the hidden input element's value
            $phone.val(phone_number);
    
            // remove the phone parts input elements
            $phones.remove();
        });
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have three input text boxes in my form. First one is teacher, second
in my form I have three input fields name, email, mobile but I want
I want to have three textboxes(only one of them will be shown to input
I have the following form: <label>One</label> Product ID:<input type=text name=productid[] value=> Product Quantity: <input
I have this form in HTML: <form action=# method=post> <label for=label-id>id</label> <input type=text name=id
So I have an input form that I want to use to update a
I have an ASP.NET form with three text inputs, one each for Work Phone,
I have three text fields: first name, last name, and age, also a photo.
I have three column in my datagridview .One is text ,one is Combo and
I have a form with three text boxes. I want to have a key

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.