blackmamba
blackmamba

Reputation: 1982

Django form action url dynamic

Is it possible to change the form action url depending on the choice user selects. Let's say he wants to create a dictionary. If he selects the choice that he wants to map the term to an existing dictionary word then go to url X else he wants to create a new term go to url Y.

The second part is if in case he wants to map the term with existing dictionary word then there can be another form with term suggestions. SO there should be nested form structure.

Upvotes: 1

Views: 1220

Answers (1)

joel goldstick
joel goldstick

Reputation: 4483

You can go to one view, do some logic, and then redirect to another view like this: https://docs.djangoproject.com/en/dev/topics/http/shortcuts/#redirect

Upvotes: 1

Related Questions