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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T15:45:24+00:00 2026-05-25T15:45:24+00:00

I have code like so: <form enctype=multipart/form-data method=POST action=blabla.php class=addToCart> <input type=button onclick=addToCartMulti(); value=Add

  • 0

I have code like so:

<form enctype="multipart/form-data" method="POST" action="blabla.php" class="addToCart">
  <input type="button" onclick="addToCartMulti();" value="Add Tracks to Cart" id="addToCart" name="addToCart">
</form>

Outside of the form tags, I have tracklisting:

<ul>
 <li><input type="checkbox" checked onclick="onSongClick(this);" id="trackNr_1" name="trackSelect" class="trackSelectionCheck"> 1. Train Love</li><li>
  .....
</ul>

I want to be able to post the form and include these other values. I have something like this for the JavaScript so far:

function addToCartMulti() {
  $("input.trackSelectionCheck").each(function(index) {
              var track = $(this).attr("id");
              var start = 8;
              var end = track.length;
              track = track.substring(start,end);
              $("form.addToCart").submit();
        });
  }

So the problem is that somewhere before this: $("form.addToCart").submit();. I need to add some JavaScript to actually include the other checkboxes so they are posted to the page.

Note: I don’t want to use ajax.

  • 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-25T15:45:24+00:00Added an answer on May 25, 2026 at 3:45 pm

    Add a hidden form field to your form, and then copy that track data you need, in whatever format you want (eg, a comma delimited list), into that hidden field. Then call submit just as you are doing now.

    Note: It appears you currently calling sumbit inside of the “each” loop, which is probably not what you want. You want to process all the checkboxes with each, and then after that is done, do the submit. So the “submit()” call should be outside of that each loop, unless I am misreading your intention.

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

Sidebar

Related Questions

I have code that looks like the following: <form id=MyForm name=MyForm method=post action=index.php> <input
hello i have a form like this <form id=ricerca enctype=application/x-www-form-urlencoded method=post action=><table class=inserisci_modifica> <tr
I've got a form which looks like that: <form method=post enctype=multipart/form-data onsubmit=return new_post_form_submit();> <input
In my javascript file, I have a code snippet like: $('<form action=process.php method=POST>' +
<html> <body> <form name=Upload enctype=multipart/form-data method=post> Filename: <INPUT type=file id=submit> <INPUT type=button id=send value=Upload>
On the page 'selecteditems.php' I have a form like this: <form method=POST name=selecteditems action=nextpage.php>
So I have code like: <ul> <li><FORM><INPUT class=eButton type=button value=stream1! onClick=window.open('./CSI1.html','win1','width=400,height=200,left=0,top=100,screenX=0,screenY=100')> </li> <li><FORM><INPUT class=eButton
I have an input form, nested within a div, defined like this: <div class=login-input>
In my views.py, i have a snippit of code like this: def clean_post_data(form): for
here is what my code looks like i have two forms: class Form_1 extends

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.