When define action for form

When one needs to define action parameter of form ? Across different projects I've seen forms with action defined as {% url app.view parameters %} or simply '/contact/' but also with action = "." . When do we need to provide each type of action ?

Answers


action is simply the URL that the form is submitted to.

Normally in Django, a form is submitted to the same URL that originally rendered it, which is why '.' is often used. If you want to submit it to a different URL, for instance in the case of a search box that is shown on every page but processed on a single page, you can hard-code the URL or use the {% url %} tag to reverse-lookup the value to submit to.


Need Your Help

How to send model with validation from web api 2 c#

c# asp.net asp.net-web-api asp.net-web-api2

I am working on Asp.net WebApi2 and I want to send Model + validation to client.because then with validation client application can put those validations.