2

Whenever jquery validation error messages appears. It occupies some space and push other fields downwords. I want error messages to be adjust in available space and should not disturb other fields or any other element. following is a jquery validation code that Im using.

$(document).ready(function(){ 

jQuery("#frmQuickAdd").validate({
        errorElement:'div',
        rules: {
            t_style: {
                required: true
            }
        },

        messages: {
            t_style: {
                    required: "Please select therapy style"
            }
       } 
    });

});

I tried div,label,span in errorElement:'', still having same problem and error div by default taking class 'error'. Any Idea what CSS I should write ?

3
  • Can you please create example on www.jsfiddle.com and reproduce your problem? Commented Apr 20, 2013 at 11:35
  • indianhans.org/login/userlogin You can check over this page see how error messages moving fields downwards. Commented Apr 20, 2013 at 11:38
  • jsfiddle.net/SxFBF Commented Apr 20, 2013 at 11:51

1 Answer 1

1

Basic solution is to make those error messages absolute positioned.

  1. In ul.ulsignup li add margin-bottom: 0; and padding-bottom: 10px;
  2. In ul.ulsignup li .text add position: relative;
  3. In div.error (or div div .error) add position: absolute; bottom: -15px; font-size: 10px;
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.