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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T15:20:12+00:00 2026-06-05T15:20:12+00:00

I have a registration page with the following code below: in the views: def

  • 0

I have a registration page with the following code below:

in the views:

def register_step2(request, value):
context={"type": value}
if request.method == 'POST':
    form = RegisterForm(request.POST)
    if form.is_valid():
        nric = form.cleaned_data['nric']
        name = form.cleaned_data['name']
        password = form.cleaned_data['password']
        email = form.cleaned_data['email']
        phonenumber = form.cleaned_data['phonenumber']
        dob = form.cleaned_data['dob']
        User.objects.create_user(nric, email, password)
        return HttpResponseRedirect('/')
return render_to_response('register.html', context, RequestContext(request))

in the register.html:

{% extends "base.html" %}
{% block subheader %}
{% if type == '0' %}
Are you..
{% endif %}
{% if type == '1' %}
Registration - Able Elder
{% endif %}
{% if type == '2' %}
Registration - Public
{% endif %}
{% endblock %}

{% block content %}
{% if type == '0' %}
<a href="/register/1">an elderly looking for something to do?</a>
<a href="/register/2">the public looking for someone to help you?</a>
{% else %}
<form action="/register/{{type}}/" method="post">{% csrf_token %}
<table class="center">
{% for field in able_form %}
<tr>
    <td>
        {{ field.label_tag }}: 
    </td>
    <td>
    {{ field.errors }}
    {{ field }}
    </td>
</tr>
{% endfor %}
<tr>
<td>
{{ able_form.non_field_errors }} 
</td>
</tr>
<tr>
<td colspan="2">
By clicking on "register" I agree with the terms and conditions.
</td>
</tr>
<tr>
<td colspan="2">
<input type="submit" value="register">
</form>
</td>
{% endif %}
{% endblock %}

in context_processors.py (it is setup properly in settings.py )

from forms import RegisterForm

def able_form(request):
    return {
            'able_form' : RegisterForm()}

in the forms.py

class RegisterForm(forms.Form):
    nric = forms.CharField(max_length=NAME_MAX)
    name = forms.CharField(max_length=NAME_MAX)
    password = forms.CharField(widget=forms.PasswordInput)
    confirm_password = forms.CharField(widget=forms.PasswordInput)
    email = forms.EmailField()
    postal_code = forms.IntegerField()
    phone_number = forms.IntegerField()
    date_of_birth = forms.DateField(widget=forms.DateInput)

It is to my understanding that the variable fields will display the field errors, but none is shown when I click on the register button. What am I doing wrong here?

  • 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-05T15:20:13+00:00Added an answer on June 5, 2026 at 3:20 pm

    With your update, the reason is obvious:

    You are only ever passing a blank form to your template.

    Where do you assume that the bound form with request.POST data gets returned to your template? Creating a new instance of RegisterForm(request.POST) does not magically change the form instance in your template (returned by the context processor).

    Your template only ever sees RegisterForm() — if it is to know of a form error, it must have the form that was bound with the request.POST data.

        form = RegisterForm(request.POST)
        if form.is_valid():
           ....
        context['able_form'] = form # you must pass back the bound form if you want to see errors.
    return render_to_response('register.html', context, RequestContext(request))
    

    Even then, your context processor may override this able_form key – I’d remove the context processor altogether.

    If you think it’s a great idea to have it, then you have to remember to do your form logic there or in your view.

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

Sidebar

Related Questions

I have the following code in my registration page to go to a paypal
I have a registration page which has the following password entry control: <input type=password
I have a registration page, and because of content issues we have to request
My Registration page currently looks like the following: The current styling I have for
I am using membership provider have following fields in registration page in CreateUserWizardStep 1-UserName
I have created a registration page using CI that works fine. However, I encoded
I have a button on my registration Page (Windows Phone), in 30% of pushing
I am doing a registration page coding. For that i have so many fields
I'm using ExtJS on a registration page which should have no effect on this.
I need a city/state/country Dynamic Drop-Down List in my Wordpress registration page. I have

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.