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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T10:19:38+00:00 2026-06-14T10:19:38+00:00

I am appending multiple input boxes and successfully posting one input array to the

  • 0

I am appending multiple input boxes and successfully posting one input array to the mysql as here it is.

$('<p><input type="text"  class="name" name="task" ></p>').appendTo($('#add_here'));

function addmem(id, text, number) {
    $('input.name').each(function() {
        // var te=$('input.task').val();
        $.post(
            'sendchat2.php', 
            { option: 'add_mem', id: id , text: $(this).val() }, 
            function(data) {
                alert(data);
            });
        });
    }

But now I need to post two input arrays at the same time. One input is customer name and another is his mobile number. I tried the below, but its not working correctly. Please help or suggest any alternative approach.

$('<p><input type="text"  class="name" ><input type="text"  class="number" name="task" ></p>').appendTo($('#add_here'));

function addmem(id, text, number) {
    $('input.name').each(function() {
        $('input.number').each(function() {
            $.post(
                'sendchat2.php', 
                { option: 'add_mem', id: id, text: $(this).val(), number: $(this).val()}, 
                function(data) {
                    alert(data);
                }
            );
        });
    });
}
  • 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-06-14T10:19:39+00:00Added an answer on June 14, 2026 at 10:19 am

    If the markup will always fit the scheme <name><number>

    function addmem(id, text, number) {
        $('input.name').each(function() {
            var input = $(this),
                name = input.val(),
                number = input.next().val();
    
            $.post(
                "sendchat2.php", 
                { "option": "add_mem", "id": id, "text": name, "number": number }, 
                function(data) {
                   alert(data);
                }
            );
        });
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I start with this markup: <div> <span> <label for=Item[0]>Item #1</label> <input type=text value= name=Item
My input file is actually multiple XML files appending to one file. (It's from
I am having trouble appending multiple variables to the end of a url using
Is it possible to have multiple classes that inherit/extends same class in Google AppEngine
Edit: since I was appending via text the file was not being saved properly,
Through JavaScript I am appending one query parameter to the page url and I
I'm looking for an efficient method for appending multiple strings. The way it should
I am appending some HTML elements to the page dynamically. There can be multiple
I have a counter running on one of my add input jquery functions: var
I'm looking to create a nice effect when appending multiple paragraphs to a div.

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.