scarvello
Posts: 64
|
Posted: 11/23/2015, 2:07 PM |
|
Just recopy 3 functions that are into js/jquery/captcha/ccs-captcha.js into the HEAD section of your HTML page.
These funcitons are:
function qPath(x1, y1, x2, y2, x3, y3) function qPaths() function drawCaptcha(canvas, url, bColor, fColor)
Then add another function like this:
function reload(){
// Get Canvas object from your HTML page
var canv = document.getElementById('inc_iscrizionesoggettoCaptcha1Picture');
// First of all clear it's contex
var context = canv.getContext('2d');
context.clearRect(0, 0, canv.width, canv.height);
// Set the ajax url that generate codes (note it's the same php page
// that generate HTML page with a callbackControl parameter equal to the
// id name of CAPTHA control
var url = "iscrizione.php?callbackControl=inc_iscrizionesoggettoCaptcha1";
// Call JS Function
drawCaptcha(canv, url, "255;159;113;0", "51;51;51");
}
Thats it.
Now into HTML page simply add a control like this to call the reload() function :
<button onclick="reload()" type="button" class="btn btn-primary">
<span class="glyphicon glyphicon-refresh"></span>
</button>
|