0

I have created a form in a template in my Django project. Using Django widget tweaks, I customize my template form and now i wanted to add an attribute name = "Total" in my customized form.

Html code:

{% render_field  form.amount placeholder=form.amount.label  class="stylefordate" name="total" %}

When I tried this, I couldn't able to get the value of name. Can someone please help me doing this?

sumanth
  • 751
  • 2
  • 15
  • 34
  • What do you mean by "not able to get the value of name"? What is the HTML generated by the tag? – solarissmoke Jul 16 '16 at 06:10
  • Actually, I wanted to refer that field as total, and I also assigned two other fields as 'a' & 'b'. So, when i enters the values in 'a' & 'b', 'total' will be the multiplication of a & b. Finally, I am trying to store the total in my template form to use it for the future purpose. Here's my code: {% render_field form.amount placeholder=form.amount.label class="form-control" name="total" %} – sumanth Jul 16 '16 at 13:11
  • But when i am entering a & b, i couldn't able to get total value. When i am doing this with , total value is returning. Can u please help me in doing this with {%render_field%} – sumanth Jul 16 '16 at 13:17

0 Answers0