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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T08:35:35+00:00 2026-06-17T08:35:35+00:00

I have ajax code like this which is passing form data into createfinalinvoice.php. serial_number

  • 0

I have ajax code like this which is passing form data into createfinalinvoice.php.

serial_number and skid are part of some form fields which are name=”serial_number[]” and name=”skid[]” (See below)

$(document).ready(function() {
    $("form#submit").submit(function() {
        // we want to store the values from the form input box, then send via ajax below
        var invoice_temp_id = $('#invoice_temp_id').attr('value');
        var customer = $('#customer').attr('value');
        var date = $('#date').attr('value');
        var shipdate = $('#shipdate').attr('value');
        var shipvia = $('#shipvia').attr('value');
        var ponumber = $('#ponumber').attr('value');
        var rep = $('#rep').attr('value');
        var invoicenotes = $('#invoicenotes').attr('value');
        var serial_number = $('#serial_number').attr('value');
        var skid = $('#skid').attr('value');
        var finalize_invoice = $('#finalize_invoice').attr('value');

        $.ajax({
            type: "POST",
            url: "includes/createfinalinvoice.php?",
            data: "invoice_temp_id="+ invoice_temp_id+
                "&customer="+ customer+
                "&date="+ date+
                "&shipdate="+ shipdate+
                "&shipvia="+ shipvia+
                "&ponumber="+ ponumber+
                "&rep="+ rep+
                "&invoicenotes="+ invoicenotes+
                "&serial_number="+ serial_number+
                "&skid="+ skid+
                "&finalize_invoice="+ finalize_invoice,
            success: function(data) {
                $('form#submit :input').not('input[type="submit"]').val("");
                $('div.success').fadeIn();
                $('div.success').html(data);
            }
        });

        return false;
    });
});

<form>
    <input type="text" name="serial_number[]" id="serial_number" class="serial_number">
    <input type="text" name="skid[]" id="skid" class="skid">
    <input type="text" name="serial_number[]" id="serial_number" class="serial_number">
    <input type="text" name="skid[]" id="skid" class="skid">
    <input type="text" name="serial_number[]" id="serial_number" class="serial_number">
    <input type="text" name="skid[]" id="skid" class="skid">
    <input type="text" name="serial_number[]" id="serial_number" class="serial_number">
    <input type="text" name="skid[]" id="skid" class="skid">
</form>

Since I am passing multiple of the same name it puts it in array. I am having a hard time figuring out how to get the AJAX code to read the array and pass it along. As of now the code just passes the first of each as a string instead of an array.

  • 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-17T08:35:35+00:00Added an answer on June 17, 2026 at 8:35 am

    try using serialize! works wonders

    $( document ).on( 'submit', "form#submit", function( ) {
     $.ajax({
                type: "POST",
                url: "includes/createfinalinvoice.php?",
                data: $( this ).serialize(),
                success: function(data){
                    $('form#submit :input').not('input[type="submit"]').val("");
                    $('div.success').fadeIn();
                    $('div.success').html(data);
                    }
                });
            });
            return false;
    
    });
    

    im using jquery’s .on here too, as its more powerful, and overall, better than just binding to the element.

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

Sidebar

Related Questions

I have this code which works. $.ajax({ type: GET, url: includes/process.php, data: captcha= +
i have code like this. which is actually a form .which lets user updates
I have the following code: $.ajax({ async: false, url: 'chart_data.php', data: {'option':'high', 'id':id}, dataType:
I'm using the following code to have multiple ajax requests like this: request 1
i have view which looks something like this : <% using (Ajax.BeginForm(new AjaxOptions {
I have this login form which uses AJAX to query a database for checking
I have this script which makes possible the insertion of some data using ajax
I have this ajax call, which works for the most part, but it does
I'm new to Jquery. I have a code like this : $.ajax({ url: ${createLink(controller
I have created ajax code for my city tabs to display respective city data

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.