Shows text field is required even before submission

17 views
Skip to first unread message

Krishnanunni Radhakrishnan

unread,
Jul 25, 2015, 6:01:31 AM7/25/15
to Django users

View

Template


Form


Server

What am i doing wrong?What should I change in order for The field is required to appear only after submission?

Tynor Fujimoto

unread,
Jul 25, 2015, 6:22:48 AM7/25/15
to django...@googlegroups.com
The last line of your view should read:

return render(response, 'signup.html', {'form': form})

Currently you are constructing it with the POST data, which is empty on GET requests. Therefore giving you field is required errors. 

-T


--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/2aa7deea-9506-4966-9f51-4e2c861031a8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages