Hello all
What I am trying to do sounds simple but I can’t make it to work… I didn’t find any solution on this forum.
- I have this form with < select > and some < options > from the database
- When the user selects a new option the form submits automatically with javascript, makes a save or update in the view and then renders the same page again
- Now I want the created/updated field to be selected by outputting < option selected > so I loop trough the database and I want to set the variable
What is the best approach for this?
When I try {% with selected = "selected %} I can’t use that variable outside the for loop.
I tried {% firstof “selected” as selected %} and {% trans “selected” as selected %} but didn’t work.
Thanks for the reply.