Changeset 2160015
- Timestamp:
- 09/20/2019 12:12:44 PM (6 years ago)
- Location:
- contractor-contact-form-website-to-workflow-tool/trunk
- Files:
-
- 3 edited
-
css/custom.css (modified) (1 diff)
-
js/custom.js (modified) (1 diff)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
contractor-contact-form-website-to-workflow-tool/trunk/css/custom.css
r2093546 r2160015 358 358 display: table-cell; 359 359 width: 50%; 360 vertical-align: top; 360 361 } 361 362 .customer-page-container .inline-fields-col:first-child { -
contractor-contact-form-website-to-workflow-tool/trunk/js/custom.js
r2093546 r2160015 246 246 function createCaptcha() { 247 247 //clear the contents of captcha div first 248 document.getElementById('jp_captcha').innerHTML = ""; 249 var charsArray = 250 "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ@!#$%^&*"; 251 var lengthOtp = 6; 252 var captcha = []; 253 for (var i = 0; i < lengthOtp; i++) { 254 //below code will not allow Repetition of Characters 255 var index = Math.floor(Math.random() * charsArray.length + 1); //get the next character from the array 256 if (captcha.indexOf(charsArray[index]) == -1) 257 captcha.push(charsArray[index]); 258 else i--; 248 if(document.getElementById('jp_captcha')) { 249 document.getElementById('jp_captcha').innerHTML = ""; 250 var charsArray = 251 "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ@!#$%^&*"; 252 var lengthOtp = 6; 253 var captcha = []; 254 for (var i = 0; i < lengthOtp; i++) { 255 //below code will not allow Repetition of Characters 256 var index = Math.floor(Math.random() * charsArray.length + 1); //get the next character from the array 257 if (captcha.indexOf(charsArray[index]) == -1) 258 captcha.push(charsArray[index]); 259 else i--; 260 } 261 var canv = document.createElement("canvas"); 262 canv.id = "jp_captcha_img"; 263 canv.width = 100; 264 canv.height = 50; 265 var ctx = canv.getContext("2d"); 266 ctx.font = "25px Georgia"; 267 ctx.strokeText(captcha.join(""), 0, 30); 268 //storing captcha so that can validate you can save it somewhere else according to your specific requirements 269 code = captcha.join(""); 270 document.getElementById("jp_captcha").appendChild(canv); // adds the canvas to the body element 259 271 } 260 var canv = document.createElement("canvas");261 canv.id = "jp_captcha_img";262 canv.width = 100;263 canv.height = 50;264 var ctx = canv.getContext("2d");265 ctx.font = "25px Georgia";266 ctx.strokeText(captcha.join(""), 0, 30);267 //storing captcha so that can validate you can save it somewhere else according to your specific requirements268 code = captcha.join("");269 document.getElementById("jp_captcha").appendChild(canv); // adds the canvas to the body element270 272 } 271 273 createCaptcha(); -
contractor-contact-form-website-to-workflow-tool/trunk/readme.txt
r2093660 r2160015 20 20 21 21 == Changelog == 22 = 3.0.4 = 23 1. Captcha Bug fixes 24 22 25 = 3.0.3 = 23 26 1. Enable Canadian Zip Code
Note: See TracChangeset
for help on using the changeset viewer.