Hi,
I'm having a problem here and I don't really know how to solve it.
I have a form on a page, the add user page:
(r'^manager/operations/nlsciadc/users/adduser/$', add_user),  #The
template is add_user.html

When the user presses submit, the action on the form sends the user
to:
<form name="form1" id="form1" action="resultadd/"  method="POST">

This on my urls.py call the view function result_add:
(r'^manager/operations/nlsciadc/users/adduser/resultadd/$',
result_add),

If an error occurs in the form, for example, the passwords don't
match, the user is sent back to the add_user.html template:
if not form.is_valid():

        return render_to_response('add_user.html', {'form':form})

The problem is that when the user is sent back to the add user page to
correct the errors, instead of going to the URL manager/operations/
nlsciadc/users/adduser/ it remains in the URL manager/operations/
nlsciadc/users/adduser/resultadd/ so when the user presses the submit
button again the user is sent to the URL /manager/operations/nlsciadc/
users/adduser/resultadd/resultadd/ which obviously isn't mapped on the
urls.py file.

The only thing I can think of is telling the user to press the back
button and fill the form again, but besides this being a lame
solution, it's much better for the user to have the filled form with
the errors next to each field and just having to correct them, instead
of having to go back and fill the form.

I don't really know how to fix this. Is there anyway in the view in
which I can call an URL in the http response? Anyone has any ideas?


--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to