views:

27

answers:

1

I'm using jQuery validate for a contact form:


$(document).ready(function(){
            $("#contactFormid").validate();
          });

and i'm using this rails plugin to generate recaptcha on my page


recaptcha_tags :public_key => 'xxxxxxxxxxxxxxxxxxxxxx_xxxxxxxxxxxxxx' , :display=>{:theme=>"white" }

how do i get jquery validate to validate my recaptcha tags before sending the info....

i have everything validated with jquery and i don't want to change it to validate on the model....

+2  A: 

Captcha should be validated at the server side not at the client side. The actual captcha words are available only on the server side not on the client side. If you are storing it on client side, you are leaving a way for a bot to figure it out which defeats the whole purpose of captcha itself.

Teja Kantamneni
you're pretty right... but then in order to get the perfect validation i should move all validations from jquery to my model on rails?
Mr_Nizzle
Not necessarily, Also in rails having the validations in model is the right thing right? Also Capthca is strictly not a validation. Validation generally implies to capture/stop people entering data wrong, captcha is to differentiate b/w hummans vs bots
Teja Kantamneni