Stop commenting if fields are not set

Firstly, I have jQuery installed, so the form does not submit: http://jsfiddle.net/FztLS/1/

Only if no fields are specified, it is not sent. I was wondering if anyone knows what is going wrong in the script.

I assumed that it is return false;applicable only if the field is empty.

Also, how to apply a class to each empty, and not just the first?

Finally, is there a better way to turn on the verification of the radio camera?

+5
source share
4 answers

Update the offer elseto:

else {
    $('#respond input, #respond textarea').removeClass('form_error');
    $('#commentform').submit();
}

Here's the fiddle: http://jsfiddle.net/FztLS/5/

0
source

'submit' , .

FYI, $("section#respond") - . , . : $("#respond").

0

:

if ($('input[name="rating"]:not(:checked)').val()) {

, , , , false.

:

if($('input[name="rating"]:checked').length === 0) {

, " ".

0

, , : http://jsfiddle.net/yBmdx/20/

, , if($validForm) -

0

All Articles