Re: How to do validation on a form which is opened by clicking a button

2020-03-01 Thread Sunil BK
Hey Guys Thanks for your reply!! I finally managed to get the code running. The reason for no showing up the validation messages was, that I my action within the form action method was set to POST. When I have switched that to GET, everything worked as expected. Thanks Sunil Am Freitag,

Re: How to do validation on a form which is opened by clicking a button

2020-02-28 Thread Naveen Arora
Use this as below in your view - context["form"] = YourForm(request.POST or None) and just a method if form.is_valid(), there is no need for the else part. On Friday, 28 February 2020 02:41:04 UTC+5:30, Sunil BK wrote: > > Hello community > > I am trying to build a simple form which can be

Re: How to do validation on a form which is opened by clicking a button

2020-02-27 Thread 'rossm6' via Django users
If the form is not valid you are creating a new form and returning this to the user. So you need to remove the line where you create this second form object within the else clause of the view and it will work. On Thu, Feb 27, 2020 at 9:10 PM Sunil BK wrote: > Hello community > > I am trying to

How to do validation on a form which is opened by clicking a button

2020-02-27 Thread Sunil BK
Hello community I am trying to build a simple form which can be opened using a button. It should offer some fields which should be further process after validation. And there is exactly my issue. When I write some data into the fields and click the submit button. the validation error is NOT