title: Insert <input id='name'> value inside <img src=.....>
body: <p>How can I insert a value stored inside an input box into img scr= tag.
  I found this code to create barcode</p>
  <pre><code>&lt;div id=&quot;aggiungi&quot; class=&quot;modal fade&quot; role=&quot;dialog&quot;&gt;
          &lt;form method=&quot;post&quot; class=&quot;form-horizontal&quot; role=&quot;form&quot; name=&quot;invio&quot;&gt;
              &lt;div class=&quot;modal-dialog modal-lg&quot;&gt;
                  &lt;!-- Modal content--&gt;
                  &lt;div class=&quot;modal-content&quot;&gt;     
                      &lt;div style='text-align: center;'&gt;
                      &lt;!-- insert your custom barcode setting your data in the GET parameter &quot;data&quot; --&gt;
                         &lt;img alt='Barcode Generator TEC-IT'src='https://barcode.tec-it.com/barcode.ashx?data=Nome%5Ct+Cognome%5Cn&amp;code=&amp;multiplebarcodes=false&amp;translate-esc=true&amp;unit=Fit&amp;dpi=96&amp;imagetype=Gif&amp;rotation=0&amp;color=%23000000&amp;bgcolor=%23ffffff&amp;codepage=Default&amp;qunit=Mm&amp;quiet=0&amp;hidehrt=False'/&gt;
                      &lt;/div&gt;
                      &lt;div style='padding-top:8px; text-align:center; font-size:15px; font-family: Source Sans Pro,   Arial, sans-serif;'&gt;
                      &lt;!-- back-linking to www.tec-it.com is required --&gt;
                          &lt;a href='https://www.tec-it.com' title='Barcode Software by TEC-IT' target='_blank'&gt;
                          TEC-IT Barcode Generator&lt;br/&gt;
                              &lt;!-- logos are optional --&gt;
                              &lt;img alt='TEC-IT Barcode Software' border='0' src='http://www.tec-it.com/pics/banner/web/TEC-IT_Logo_75x75.gif'&gt;
                          &lt;/a&gt;
                       &lt;/div&gt;
                  &lt;/div&gt;
            &lt;/form&gt;
   &lt;/div&gt; 
  </code></pre>
  <p>I would like to change Nome and Cognome inside the scr=.... using the value inserted into two input box like these:</p>
  <pre><code>&lt;input type=&quot;text&quot; class=&quot;form-control&quot; id=&quot;name&quot; name=&quot;name&quot;&gt;
  &lt;input type=&quot;text&quot; class=&quot;form-control&quot; id=&quot;cognome&quot; name=&quot;cognome&quot;&gt;
  </code></pre>
  <p>Eventually I have these two variables stored also inside two javascrip variables (javascript function)</p>
  <p>PS in edit:
  <strong>The code is inside a bootstrap modal</strong></p>
  <p><a href="https://i.stack.imgur.com/1J30b.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1J30b.png" alt="enter image description here" /></a></p>
  <p>As you can see from the image Nome &amp; Cognome below the barcode must take the values inserted in the input boxes. Really I'm trying to show the barcode only when all input boxes are filled. I already have Nome &amp; Cognome declared as javascript variable (var nome = document.getElementById('nome').value; and the same for cognome) inside another javascript function, called by a onkeyup event on these two input boxes. My problem is how to change them inside img scr=...I tried to insert as &lt; script&gt;.... or as &lt;?php ... but without positive result</p>