I wrote this script for my validation page.I used javascript and jquery mixed it all up. For some reason when I submit the gender validation doesnt work right, it keeps asking to validate but every other condition works. What I've pasted below is just the gender condition and the "if everything goes right to submit the page" condition, this is all included in a function ( function validate )
if($('.sex').not(':checked')) //check if gender is checked****************************************************************
{
$('.gender_txt').css("background-color","yellow")
$("#gender_error").html("Please select your gender").css("background-color","red").css( "text-align","center").fadeIn("slow");
$("#error_notice").html("Please fill in the red fields you missed above ").css("background-color","red").css( "text-align","center" )
.fadeIn("slow");
$('.sex').click(function()
{ $('.gender_txt').css("background-color","#B9BFAB");
});
}
if (( user_value.length > 5) && (allow_char.test(user_value)) && (pass_value.length > 5) && (allow_char.test(pass_value)) &&
(pass_value == pass2_value) && (letters.test(fname_value)) && (letters.test(lname_value)) && ($('.sex').is(':checked'))
((e_value.indexOf('@') != -1) || (e_value.indexOf('.') != -1)))
{
$('#registerForm').submit();
}
}