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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T07:30:24+00:00 2026-06-04T07:30:24+00:00

The user selects a slot via a checkbox and also should enter a username,

  • 0

The user selects a slot via a checkbox and also should enter a username, as shown in the template below:

<form action="/clubs/{{ club.id }}/vote/" method="post">
{% csrf_token %}
{% for slot in tom_open_slots %}
    <input type="checkbox" name="slot" id="slot{{ forloop.counter }}" value="{{ slot.id }}" />
    <label for="slot{{ forloop.counter }}">{{ slot.slot }} on Court {{slot.court}}</label><br />
{% endfor %}    
<input type="text" name="username" />
<input type="submit" value="Reserve" />

I then would like to display the username that was typed and time selected in the checkbox. I do this through the view and template below:

def vote(request, club_id):
    if 'username' in request.GET and request.GET['username'] and 'slot' in request.GET and request.GET['slot']:
        username = request.GET['username']
        slot = request.GET['slot']
        return render_to_response('reserve/templates/vote.html',{'username':username, 'slot':slot})
    else:
        return HttpResponse('Please enter a username and select a time.')


{{slot}}
{{username}}

When I go to vote.html though, I always get the error message though (Please enter a username and select a time). What is incorrect in the view that is not picking up the 2 GET parameters?

  • 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-04T07:30:26+00:00Added an answer on June 4, 2026 at 7:30 am

    You are using POST request in your form:

    <form action="/clubs/{{ club.id }}/vote/" method="post">
    

    But in the view, you are checking the GET object which comes from GET request:

    request.GET
    

    Change your form method to method="get" to fix the problem.

    Edit: read more on GET vs POST request here: When do you use POST and when do you use GET?

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

Sidebar

Related Questions

I have a form where a user selects a file, and then should be
For a given slot the user selects (which should have time, club, day, and
Query below works fine when user selects different dates but when user selects same
I have a form where the user selects field 1, and then selects field
I have a textarea where when the user selects and presses enter I want
I have a form where user selects 'fruit's from a popup form. I am
I have a form in which the user selects a few items to display
A user selects a portion of an image for a cut and paste operation.
The user selects a state from a drop-down field, then ajax posts that value
Suppose a user selects a file in a dialogue box, and the app then

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.