examples/form/dynamic.html
authorChris <chris@roojs.com>
Tue, 8 Oct 2013 09:19:37 +0000 (17:19 +0800)
committerChris <chris@roojs.com>
Tue, 8 Oct 2013 09:19:37 +0000 (17:19 +0800)
examples/form/dynamic.html

index f30f8fd..3bcef30 100644 (file)
 
     <div style="width:600px;" class="roodocs-formblock">
             <h3 style="margin-bottom:5px;">Signature</h3>
-            <div id="form-ct7"> </div>
+            <div id="form-ct7">
+                    <p>Please sign on the dotted line below.</p>
+    <iframe src=signature.svg></iframe>
+    <div>
+    <button onclick=showSignature()>Show signaure path data</button>
+    <button onclick=clearSignature()>Clear signature</button>
+    <div id=pathdata></div>
+    </div>
+    <script>
+    var svg = document.getElementsByTagName('iframe')[0].contentWindow;
+    var pathdata = document.getElementById('pathdata');
+
+    function showSignature() {
+        pathdata.textContent = svg.getSignature();
+    }
+
+    function clearSignature() {
+        svg.clearSignature();
+        pathdata.textContent = '';
+    }
+    </script>
+            </div>
     </div>
     
     <div class="x-form-clear"></div>