I need to check whether the bird is worth on the checkbox, and if not, print the message and not send the form data, and if it is worth sending the form. How is it? here is my code http://jsfiddle.net/AJIEKCEU/QPmEt/



    2 answers 2

    // ... if(!$("#robot1").prop("checked")) { $('.btn').before('<p class="inputs_error">Подтвердите, что Вы не робот.</p>'); return false; } //... 

      you can use selector :checked :

       if(!$("#robot1").is(":checked")) { $('.btn').before('<p class="inputs_error">Подтвердите, что Вы не робот.</p>'); return false; } 

      This is how I would do, instead of adding text every time, besides, the handler must be hung on the submit form and not on a click on the submit button.

      http://jsfiddle.net/oceog/QPmEt/5/