Reusing a form before submitting it

I am 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 them say that the flags are the styles of music, and the selector is for the names of people.

I would like the user to be able to select music styles for several people and then submit a form with all the data.

For example, a user can first check Classical, Jazz, Rock and Pop and select "Joe", then select Jazz, Pop, Country and Electronica and select "Jane". Thus, for "send person" and "send form" there should be two different buttons.

I would like to:

  • Indicate the list of names and their chosen styles below the form, for feedback
  • Allow the user to use the form as much as he wants, and then send all the data at the end

I have the feeling that using jquery and JSON is perfect for this, but I don't know what search terminology to use to figure out how to do this.

If that matters, the form will be handled by the Django view in Python.

+3
source share
2 answers

You can achieve this using AJAX to submit. Your workflow should look like this:

  • The user selects Joe and their respective music styles.
  • " ". (Joe) , JSON, script AJAX (jquery ajax()).
  • script . , "AJAX call" . , , "Joe", , Joe .
  • , , .

PS - AJAX, JSON. POST. Javascript JSON, JSON.stringify()

, , ( - ), , , " ", Javascript, . JS.

, " ", .

+1

All Articles