INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

NoCaptcha ReCaptcha/Bootstrapvalidator

NoCaptcha ReCaptcha/Bootstrapvalidator

(OP)
Has anyone had any luck implementing NoCaptcha ReCaptcha with the Bootstrapvalidator using Classic ASP?

Thanks.

Swi

RE: NoCaptcha ReCaptcha/Bootstrapvalidator

(OP)
I got this working posting to another page and then verifying the Captcha result (g-recaptcha-response).

However, I was hoping to do this without posting to another form for the verification as BootStrap allows me to verify all other user entered data before I post to see if the person is an authenticated user or if they already registered against my DB.

Thanks.

Swi

RE: NoCaptcha ReCaptcha/Bootstrapvalidator

If it works when pointed to a different URL then it will also work on the same URL. You simply have to check if the form HAS been submitted before the verification code is run, if not ... display the form.


CODE --> vbscript

If request.form('submit') then
     'verify code here
else
     ' display form
end if 

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum

RE: NoCaptcha ReCaptcha/Bootstrapvalidator

(OP)
Ok, but is there a way to do this right in Bootstrapvalidator itself.

I have some boostrapvalidator code that validates the form before the form is submitted.

CODE

<script>
  $(document).ready(function() {
    $('#registered').bootstrapValidator({
        container: '#messages',
        feedbackIcons: {
            valid: 'glyphicon glyphicon-ok',
            invalid: 'glyphicon glyphicon-remove',
            validating: 'glyphicon glyphicon-refresh'
        },
        fields: {
            firstname: {
                validators: {
                    notEmpty: {
                        message: 'First Name is required and cannot be empty'
                    },
                    stringLength: {
                        max: 30,
                        message: 'First name cannot be longer than 30 characters'
                    }
                }
            },
            lastname: {
                validators: {
                    notEmpty: {
                        message: 'Last Name is required and cannot be empty'
                    },
                    stringLength: {
                        max: 30,
                        message: 'Last name cannot be longer than 30 characters'
                    }
                }
            },
            city: {
                validators: {
                    notEmpty: {
                        message: 'City is required and cannot be empty'
                    },
                    stringLength: {
                        max: 30,
                        message: 'City cannot be longer than 30 characters'
                    }
                }
            },
            state: {
                validators: {
                    notEmpty: {
                        message: 'State is required and cannot be empty'
                    }
                },
            },
            zip: {
                validators: {
                    zipCode: {
                        country: 'US',
                        message: 'The zip is not valid US postal code'
                    },
                    notEmpty: {
                        message: 'Zip is required and cannot be empty'
                    },
                    stringLength: {
                        max: 10,
                        message: 'Zip cannot be longer than 10 characters'
                    }
                },
            },
            mobile: {
                validators: {
                    phone: {
                        country: 'US',
                        message: 'Mobile Phone is not valid US phone number'
                    },
                    notEmpty: {
                        message: 'Mobile Phone is required and cannot be empty'
                    },
                    stringLength: {
                        max: 12,
                        message: 'Mobile Phone cannot be longer than 12 characters'
                    }
                }
            },
            home: {
                validators: {
                    phone: {
                        country: 'US',
                        message: 'Home Phone is not valid US phone number'
                    },
                    stringLength: {
                        max: 12,
                        message: 'Home Phone cannot be longer than 12 characters'
                    }
                }
            },
            password: {
                validators: {
                    notEmpty: {
                        message: 'Password is required and cannot be empty'
                    },
                    stringLength: {
                        max: 8,
                        message: 'Password cannot be longer than 8 characters'
                    }
                }
            },
            confirmpassword: {
                validators: {
                    identical: {
                        field: 'password',
                        message: 'The password and the confirmation are not the same'
                    },
                    notEmpty: {
                        message: 'Confirm Password is required and cannot be empty'
                    },
                    stringLength: {
                        max: 8,
                        message: 'Confirm Password cannot be longer than 8 characters'
                    }
                }
            }
        }
    }); 

If all validates it lets me post to the next page and this is where I perform the ReCaptcha lookup:

CODE

Dim recaptcha_secret
Dim objXML
recaptcha_secret = "XXXXXXXXXXXXXXXXXXXXXXXX"

Dim sendstring
sendstring = _
   "https://www.google.com/recaptcha/api/siteverify?" & _
   "secret=" & recaptcha_secret & _
   "&response=" & request.form("g-recaptcha-response")

Set objXML = Server.CreateObject("MSXML2.ServerXMLHTTP")
objXML.Open "GET", sendstring , false

objXML.Send()

if instr(objXML.responseText,"false") > 0 then
        response.redirect "/register.asp?badlogin=4"
end if

%> 

Do you know if I can do this in bootstrapvalidator instead of posting to another page? When I post to the other page I also hit the database for authentication.

Thanks.

Swi

RE: NoCaptcha ReCaptcha/Bootstrapvalidator

Quote:

Ok, but is there a way to do this right in Bootstrapvalidator itself.

Probably, but that would be client side javascript (forum216: Javascript) not ASP.

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close