form validation not working properly
===

i am validating a form with jquery and having some problems.
jquery validation code:

    $(function(){
        var form = $('#contactus');
        var name = $('#name');
        var nameInfo = $('#nameInfo');
        var email = $('#email'); 
        var emailInfo = $('#emailInfo');
        var phone = $('#phone');
        var phoneInfo = $('#phoneInfo');
        var msg = $('#message');
        var msgInfo = $('#messageInfo');
        var reg=/^[a-zA-Z. ]+$/;
        var mail=/^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/; 
        
        
        
        
        
        function validateName()
        {
            if(name.val()=='')
            {
                name.addClass('error');
                nameInfo.text('Please fill up your full Name');
                nameInfo.addClass('error');
                return false;
            }else if(reg.test(name)==false){
                name.addClass('error');
                nameInfo.text('Only letters are allowed');
                nameInfo.addClass('error');
                return false;
            }else{
                name.removeClass('error');
                nameInfo.text('');
                nameInfo.removeClass('error');
                return true;
            }
        }
        function validateEmail()
        {
            if(email.val()=='')
            {
                email.addClass('error');
                emailInfo.text('Please fill in your Valid Email');
                emailInfo.addClass('error');
                return false;
            }else if(mail.test(email)==false){
                email.addClass('error');
                emailInfo.text('Invalid Email');
                emailInfo.addClass('error');
                return false;
            }else{
                email.removeClass('error');
                emailInfo.removeClass('error');
                return true;
            }
        }
        function validatePhone()
        {
            if(phone.val()=='')
            {
                phone.addClass('error');
                phoneInfo.text('Please fill in your Phone number');
                phoneInfo.addClass('error');
                return false;
            }else if(isNaN(phone)){
                phone.addClass('error');
                phoneInfo.text('Please fill in your Phone number');
                phoneInfo.addClass('error');
                return false;
            }else{
                phone.removeClass('error');
                phoneInfo.removeClass('error');
                return true;
            }
        }
        function validateMsg(){
            if(msg.val()=='')
            {
                msg.addClass('error');
                msgInfo.text('Please enter your Message');
                msgInfo.addClass('error');
                return false;
            }else if(msg.val().length<10){
                msg.addClass('error');
                msgInfo.text('Please enter at least 10 words');
                msgInfo.addClass('error');
                return false;
            }else{
                msg.removeClass('error');
                msgInfo.removeClass('error');
                return true;
            }
        }
        
        /*name.blur(validateName);
        email.blur(validateEmail);
        phone.blur(validatePhone);
        msg.blur(validateMsg);*/
        
        name.keyup(validateName);
        email.keyup(validateEmail);
        phone.keyup(validatePhone);
        msg.keyup(validateMsg);
        
        form.submit(function(){
            if(validateName() ,validateEmail() , validatePhone(), validateMsg() ){
                return true;
            }else{
                return false;
            }
        })
    })
and php form code is:

    <form name="contactus"  id="contactus" action="" method="post">
        	<ul class="form_field">
                <li><label>Your Name :</label>
                    <input class="form_input" type="text" name="name" id="name" value="<?php echo $_POST['name'];?>" />
                    <span id="nameInfo"></span>
                </li>
                <li><label>Email Address :</label>
                    <input class="form_input" type="text" name="email" id="email" value="<?php echo $_POST['email'];?>" />
                    <span id="emailInfo"></span>
                </li>
                <li><label>Phone Number :</label>
                    <input class="form_input" type="text" name="phone" id="phone" value="<?php echo $_POST['phone'];?>" />
                    <span id="phoneInfo"></span>
                </li>
                <li><label>Your Message:</label>
                    <textarea class="form_input" name="message" id="message"><?php echo $_POST['message'];?></textarea>
                    <span id="messageInfo"></span>
                </li>
                <li><?php echo recaptcha(); ?></li>
                <li><label>&nbsp;</label><input type="submit" class="submit_btn" value="Submit"  name="submit"/></li>
            </ul>
        </form>

problem is second condition isn't validated properly for any of the form elements. Though null condition is succeded 2nd condition isn't. am i doing any wrong.any help/suggestions is welcome. thanks a lot.


   
   
    
