I forgot to add my form post...here it is  ...

<form action="/register/" method="post">
        {% if form.error_dict %}
        <p class="error">Please correct the errors below.</p>
        {% endif %}

<br/>
        {% if form.username.errors %}
        {{ form.username.html_error_list }}
        {% endif %}
        <label for="id_username">Username:</label>
        <input type="text" name="username" id="id_username" class="txt" />

<br/>
        {% if form.email.errors %}
        {{ form.email.html_error_list }}
        {% endif %}
        <label for="id_email">Email:</label>
        <input type="text" name="email" id="id_email" class="txt" />

<br/>
        {% if form.password1.errors %}
        {{ form.password1.html_error_list }}
        {% endif %}
        <label for="id_password1">Password: </label>
        <input type="password" name="password1" id="id_password1"
class="txt" />

<br/>
        {% if form.password2.errors %}
        {{ form.password2.html_error_list }}
        {% endif %}
        <label for="id_password2">Password (again):</label>
        <input type="password" name="password2" id="id_password2"
class="txt" />
<br/>
        <input type="submit" name="submit" id="submit" value="Sign Up!"
class="btn" />

</form>

On Nov 2, 12:55 pm, Andrew <andrew.penr...@gmail.com> wrote:
> Hi,
> I am well used to working with Django, however I am stuck on a basic
> issue at present if anyone can spread some light. Note I have no
> compile errors and it runs fine. I have put in a variable "result" to
> check the value of form.is_valid() which is showing as always True.  I
> have tried everyting initially thinking it was my Ubuntu dev
> environment but I ran it on debian etch with django version 1.0.3 and
> got the same thing. Any help greatly appreciated.
> Thanks
> Andrew
>
> Here is the scenario....
> I am doing a simple registration form...
>
> I have a form... as you can see I have "required=True" on the username
> to test validation
> class RegistrationForm(forms.Form):
>     username = forms.CharField(required=True),
>     email = forms.EmailField(required=True),
>     password1 = forms.CharField(required=True),
>     password2 = forms.CharField(required=True),
>
> I have a pattern in my url.py as you do...
>     (r'^register/$','myproject.views.register'),
>
> I have a method in my view that takes the post...
> def register(request):
>     if request.user.is_authenticated():
>         return HttpResponseRedirect("/")
>     result = ""
>     if request.method == 'POST':
>         form = RegistrationForm(request.POST)
>         if form.is_valid():
>             result = True
>         else:
>             result = False
>
>     else:
>         form = RegistrationForm()
>     form = RegistrationForm()
>     return render_to_response('pages/account/account.html', {'form':
> form,'result':result,})
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to