Friday, 9 August 2013

updating options on signature pad plugin

updating options on signature pad plugin

I am trying to update the options on Signature Pad but it does not seem to
be working.
The option that I am trying to update is the pen colour, i have created a
button that once clicked on should update the object and change the pen
colour.
var options = {
drawOnly: true,
defaultAction: 'drawIt',
validateFields: false,
lineWidth: 0,
output: null,
sigNav: null,
name: null,
typed: null,
clear: 'input[type=reset]',
typeIt: null,
drawIt: null,
typeItDesc: null,
drawItDesc: null,
penColour: '#000',
};
var api = $('form').signaturePad(options);
$('.green').click(function(){
api.clearCanvas();
$.fn.signaturePad.penColour = '#00FF00';
});
any ideas?

No comments:

Post a Comment