SignaturePad.html
SignaturePad.htm
—
HTML,
2 kB (2885 bytes)
File contents
<!DOCTYPE html> <html lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Signature Pad</title> <meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;" /> <meta name="apple-mobile-web-app-capable" content="yes" /> <meta name="apple-mobile-web-app-status-bar-style" /> <link rel="stylesheet" href="../share/css/TabletSignature.css" media="screen"/> <script type="text/javascript" src="../share/javascript/TabletSignature.js"></script> <script type="text/javascript" src="../share/javascript/jquery/jquery-1.4.2.js"></script> <script type="text/javascript" src="../share/javascript/jquery/jquery.form.js"></script> </head> <script type="text/javascript"> var _in_window = true; saveCanvas=function(){ if(document.location.href.lastIndexOf('eform/displayImage.do')){ var theContextRoot = document.location.href.replace(document.location.search,'').replace('eform/displayImage.do',''); var theScratchPadLink=theContextRoot+'/scratch/index.jsp'; var request=new XMLHttpRequest(); request.open('GET', theScratchPadLink, false); request.send(); if (request.status==200) { var theFormStart=request.responseText.indexOf('<form'); var theTextAreaStart=request.responseText.indexOf('<textarea'); var theFields=request.responseText.substring(theFormStart,theTextAreaStart); var theExpression =/<input[\s\S]*?name="([\s\S]*?)"[\s\S]*?value="([\s\S]*?)"[\s\S]*?>/gim; var theMatch; var theFormData = new FormData(); while (theMatch=theExpression.exec(theFields)){ switch (theMatch[1]) { case "providerNo": theFormData.append("providerNo", theMatch[2]); break; case "id": theFormData.append("id", theMatch[2]); break; case "windowId": theFormData.append("windowId", theMatch[2]); break; } } theFormData.append("dirty", '1'); theTextAreaStart=request.responseText.indexOf('>',theTextAreaStart)+1; theTextAreaStop=request.responseText.indexOf('</textarea'); var theTextArea = request.responseText.substring(theTextAreaStart,theTextAreaStop)+'***SIGNATURE***'+canvas.toDataURL("image/png"); theFormData.append("scratchpad", theTextArea); var request=new XMLHttpRequest(); request.open('POST', theContextRoot+'Scratch.do', false); request.send(theFormData); document.getElementById('clear').click(); } } }; </script> <body style="background-color: #555"> <div class="verticalCenterDiv"> <div class="centerDiv"> <canvas id='canvas'></canvas> <div><span id="signMessage" style="color:#FFFFFF;">Please sign in the box above this message.</span><button id="clear" style="display:none">Clear</button><button id="save" style="display:none;">Send Signature</button></div> </div> </div> </body> </html>
Document Actions