Hi Team
I have a signaturepad, created two button one to clear and save(back-end) have not yet do this. But the problem is on clear button(jquery button its not clearing the signaturepad from the form and its a business rule. How can i achieve this my code i did debug no error. is there any mate who can replacate this code and show me what was the issue?
// HTML code
// javascript code
/**
* @author:Gcobani Mkontwana
* @date:15/06/2023
* @signature to allow a user to sign using jquery library.
*
*/
$(document).ready(function() {
// initialize signature pad
var canvas = document.getElementById('signatureCanvas');
var signaturePad = new SignaturePad(canvas);
// handle clear button click
$('#clearSignatureButton').click(function(){
console.log('Clear button clicked!');
signaturePad.clear();
alert("Test1");
});
// handle save button click
$('#saveSignatureButton').click(function(){
var signatureDataURL = signaturePad.toDataURL();
alert("test2");
// send signature to the server.
$.ajax({
type:'POST',
url:'save_signature.php',
data:{
signature: signatureDataURL
}
}).done(function(response){
console.log(response);
});
});
});
Naimish MakwanaPosted Mar 16, 2023, 3:47 AM
Hello GCOBANI,
Your inline CSS is created to issue. If you remove it, It will be working.
Thanks
Naimish Makwana