title: Python Flask multiple forms leads to Multiple IDs #csrf_token
body: <p>I am using python 3 and flask in a webproject. I have multiple forms on a single page. Forms have a <code>hidden_tag()</code>, which is the <code>csrf_token</code>.</p>
  
  <p>The problem is that the id's of all <code>csrf_token</code> are the same. </p>
  
  <pre><code>[DOM] Found 2 elements with non-unique id #csrf_token:
  </code></pre>
  
  <p>I could use ajax or simply use a new page for the form, but I'd like to understand whether there is a fix for that.</p>
  
  <p>I tried to assign a custom id to each <code>hidden_tag()</code>:</p>
  
  <pre><code>{{ form.hidden_tag(id="tag_1") }}
  </code></pre>
  
  <p>But it tells me:</p>
  
  <pre><code>TypeError: hidden_tag() got an unexpected keyword argument 'id'
  </code></pre>
  
  <p>So far I was not able to find a solution.</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>The error is displayed by the browser in the console:</p>
  
  <p><a href="https://i.stack.imgur.com/ySOZB.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ySOZB.png" alt="enter image description here"></a></p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>I am trying to add the <code>hidden_tag</code>, so it will overwrite the original hidden tag, but I cant figure out how the value is created.</p>
  
  <pre><code>hidden_tag = HiddenField('EditUserPasswordHiddenTag', default="the value")
  </code></pre>
  
  <p>That is what I got:</p>
  
  <pre><code>&lt;input id="hidden_tag" name="hidden_tag" type="hidden" value="the value"&gt;
  </code></pre>