php - Signature Pad: Capturing more than one signature -
i using thomas j bradley's signature pad, need able accept (and regenerate) 2 (or more) signatures @ time. , unfortunately, right now, can first canvas widget accept signature - second canvas widget unresponsive.
maybe i'm doing wrong in javascript section?
what need change make accept 2 signatures in 1 form?
<form method="post" action="" class="sigpad"> <b>signature 1:</b> <br /> <ul class="signav"> <li class="clearbutton"><a href="#clear">clear signature</a></li> </ul> <div class="sig sigwrapper"> <div class="typed"></div> <canvas class="pad_1" width="490" height="130"></canvas> <input type="hidden" name="signature_pad_output_1" class="output_1"> </div> <br> typed name: <input type="text" name="signature_name_1" value="" id="name_1" class="name_1"> <hr> <b>signature 2:</b> <br /> <ul class="signav"> <li class="clearbutton"><a href="#clear">clear signature</a></li> </ul> <div class="sig sigwrapper"> <div class="typed"></div> <canvas class="pad_2" width="490" height="130"></canvas> <input type="hidden" name="signature_pad_output_2" class="output_2"> </div> <br> typed name: <input type="text" name="signature_name_2" value="" id="name_2" class="name_2"> <script> $(document).ready(function() { var options = { linetop: 100 , drawonly: true , canvas: '.pad_1' , output: '.output_1' , name: '.name_1' }; $('.sigpad').signaturepad(options); var options = { linetop: 100 , drawonly: true , canvas: '.pad_2' , output: '.output_2' , name: '.name_2' }; $('.sigpad').signaturepad(options); }); </script> <script src="/includes/signature-pad/build/json2.min.js"></script> </form>
thank in advance.
it looks need have different classes on pads. instead of:
⋮ $('.sigpad').signaturepad(options); ⋮ $('.sigpad').signaturepad(options); ⋮
change second 1 to:
$('.sigpad2').signaturepad(options);
check out undocumented example in downloadable package here: https://github.com/thomasjbradley/signature-pad/blob/master/examples/accept-multiple-signatures.html
Comments
Post a Comment