#Submitted from displays results in the same URl

1 messages · Page 1 of 1 (latest)

runic valve
#

i can add that the .view that is supposed to display the results is not even used, the view with the form somehow displays the results

#
          return render(request, 'cars4you/resultlist.html', context)
    return render(request, 'cars4you/prioinput.html',{'form':form})
def resultlist(request):
    # list = YourPref.objects.all()
    return render(request, 'cars4you/resultlist.html',{'result':list})
#

the top is the end of my main view with form and data processing

the bottom is the view i wanna use to display results after submit is pressed but its not ever activated

#

instead the input does all but remains on the same url

#
{% block content %}
    <section>
        <form class="form-with-validation" action="{% url 'cars4you:input' %}" method='post' enctype="multipart/form-data">
            {% csrf_token %}
            {% for field in form  %}
                <div>
                    {{field.label}}
                    {{field}}
                </div>
            {% endfor %}
            <button class="form-submit">Submit parameters</button>
        </form>
    </section>

this is my submit button

copper ermine
#

Sorry I'm not following the problem. You can't return twice from same function

#

Please share more context and code, and use syntax highlighting