D
D
Damn2019-08-02 17:16:32
Jinja
Damn, 2019-08-02 17:16:32

How to change the variable by input given by the template engine?

I pass a variable to html in this way using Jinja:

<h3>Себестоимость продаж: {{data.cost_of_sales}} </h3>

You need the ability to change its values ​​by entering it in a text field, how can this be done? Code welcome

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Gornostaev, 2019-08-02
@afilmofog

<form action="адрес обработчика" method="post">
  <input type="text" name="cost" value="{{data.cost_of_sales}}">
</form>

And of course you need to write a form handler.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question