title: szimek signature-pad saving image to file
body: <p>I use this code to copy signature pad image to a hidden field. Everything works great except chrome and safari browsers to not work.</p>
  
  <p>Form fields:</p>
  
  <pre><code>&lt;form id="sigform" action="myscript.php" method="post"&gt;
     &lt;input id="sigdataid" type="hidden" name="sigdata" value=""/&gt;
     &lt;input type="submit" value="Submit" &gt; 
  &lt;/form&gt;
  </code></pre>
  
  <p>Code in app.js:</p>
  
  <pre><code>function myFunctionsub() {
      if (signaturePad.isEmpty()) {
          alert("Please provide a signature first.");
      } else {
          var image = signaturePad.toDataURL();
          document.getElementById("sigdataid").value = image;
          document.getElementById("sigform").submit();
       }
  }
  </code></pre>
  
  <p>The hidden field does receive image data on IE and Firefox and data is present after submitting. However, Chrome and Safari do not receive the data and is not present when the form is posted.</p>
  
  <p>I have done extensive research and can not find any information on Chrome compatibility on either the <code>var image = signaturePad.toDataURL();</code> or  <code>document.getElementById("sigdataid").value = image;</code> javascript code.</p>
  
  <p>Anyone have an idea?</p>