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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T20:16:21+00:00 2026-06-01T20:16:21+00:00

I’m new to JavaScript, and trying to figure out the canonical way to do

  • 0

I’m new to JavaScript, and trying to figure out the canonical way to do the following.

I have a form with some checkboxes and a selector.
Let’s say the checkboxes are styles of music and the selector is for people’s names.

I’d like the user to be able to select the styles of music for multiple people and then submit the form with all of the data.

For example, the user might first check off Classical, Jazz, Rock, and Pop and choose “Joe”, then select Jazz, Pop, Country, and Electronica and choose “Jane”. So there would have to be two different buttons for “submit person” and “submit form”.

I would like to:

  1. Have a list of the names and their chosen styles populate below the form, for feedback
  2. Allow the user to use the form as much as they want, and then submit all the data at the end

I get the feeling that using jquery and JSON is perfect for this, but I’m not sure what search terminology to use to figure out how to do this.

If it matters, the form will be processed by a Django view in Python.

  • 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-01T20:16:22+00:00Added an answer on June 1, 2026 at 8:16 pm

    You can achieve this by using AJAX for submit person. Your work flow should go like this:

    1. User selects Joe and the corresponding styles of music.
    2. User hits ‘Submit Person’. On this event, encode the name of the person (Joe) and the styles of music selected into a JSON object and pass it to your back end script via an AJAX (jquery ajax() ) request.
    3. The server side script with do whatever processing it needs to. When it finishes, you AJAX calls’ success handler will be invoked. At this point, you can probably remove ‘Joe’ so the user knows the submission was successful and does not submit for Joe again.
    4. Wash, rinse, repeat for all other people in your form.

    PS – when you pass information to the back-end via AJAX, you do not have to encode it as JSON. You can either send it as a standard POST request. To encode a Javascript objects into JSON, use JSON.stringify()

    The above is one way of doing it, however it won’t work like you asked in your question (keep collecting data – submit at once), To work it that way, everytime the user hits ‘Submit Person’, add the data to a Javascript object, but do not submit it. The submitted data will keep building up in a JS object.

    Finally, when the user hits ‘Submit form’, stringify the data and submit it.

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

Sidebar

Related Questions

I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
I have just tried to save a simple *.rtf file with some websites and
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am trying to render a haml file in a javascript response like so:
I have a text area in my form which accepts all possible characters from
I am trying to loop through a bunch of documents I have to put
I have a small JavaScript validation script that validates inputs based on Regex. I
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
I have a jquery bug and I've been looking for hours now, I can't

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.