Little adjustment,
$.ajax({
url: '{% url "" %}',
data: {
'x': ,
},
dataType: 'json',
success: function (data) {
if (data.added_item) {
Yes that's possible since you are using Ajax. It should be something like
this:
$.ajax({
url: '{% url "" %}',
data: {
'x': ,
},
dataType: 'json',
success: function (data) {
I have a form which has a select field (your color). In front of the select
field, I have a button that produces a popup which allows users to create new
color before they submit. I am submitting that color form via Ajax. After
adding a new color to the database, the popup closes.
I want the new
3 matches
Mail list logo