Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- jQuery(document).ready(function(){
- var num1=<?=rand(0,10)?>;
- var num2=<?=rand(10,99)?>;
- jQuery('#num1').val(num1);
- jQuery('#num2').val(num2);
- jQuery('#number1').html(num1);
- jQuery('#number2').html(num2);
- jQuery('.questionCaptcha').text(num1+"+"+num2);
- var sum=num1+num2;
- jQuery(".wpcf7-form").attr('onsubmit','return contactval();');
- });
- function contactval(){
- var numz=jQuery('.questionCaptcha').text().split('+');
- var sum=parseInt(numz[0])+parseInt(numz[1]);
- var sum1=jQuery('#sum').val();
- if(sum1==sum){
- return true;
- }
- else{
- alert('incorrect captcha');
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement