Hello everybody,

Ok so i am a complete beginner in both jQuery, JavaScript and english.
I build a script to check a survey for empty questions, if so show a
new tr and make a list of empty questions. If the script detects no
errors it will submit the form.

It worked like a charm in firefox but on no other browser it seemed to
work.

function checkSurvey(){
        $(".error").removeClass("error");
        $("#error").addClass("error");
        errormsg = '';
        error = false;
        $(".question").each(function(){
                if ( $(this).find('input:checked').length>0){
                        i = this.id.substr(2);
                        errormsg += '<a href="#'+this.id+'">Fout bij vraag 
'+i+'</a><br /
>';
                        error = true;
                        $(this).addClass("error");
                }
        });
        if(errormsg!=''){
                $("#error").show();
                $("#error td div")[0].innerHTML = errormsg;
        }
        else{
                $("#survey")[0].submit();
        }
}

...

Help!

Reply via email to